Remove parsing on nested double-quotes

2 posts, 0 answers
  1. Mark
    Mark avatar
    1 posts
    Member since:
    Mar 2012

    Posted 29 Dec 2014 Link to this post

    We have found that some of our end users are pasting HTML into the editor that has nested double quotes for a URL. When they save their changes and the editor parses that HTML the changes the editor makes are even worse. We realize that this HTML is not compliant in the first place but is there any way to disable this specific type of change? We would prefer to preserve incorrect HTML than to have the editor make any further changes.

    Our customers may paste in code like this:
    <td style="width: 133px; height: 20px; text-align: center; vertical-align: middle; background-image: url("/resource/resmgr/IDGuard/LandTab_M.png");"> </td>
    Which then gets changed into something like this:
    <td style="width: 133px; height: 20px; text-align: center; vertical-align: middle; background-image: url(" resource="" resmgr="" idguard="" landtab_m.png);"=""> </td>

    Alternatively, if there is a way to get it to change their source so that it is correct, with the URL in a single-quote that would be ideal.

    Thanks
  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 05 Jan 2015 Link to this post

    Hello Mark,

    You can try using the OnClientPasteHtml event and change the pasted content as per to the requirements. I believe that by simply encoding the quotes will fix the issue, alternatively, you can replace double quotes with single ones with RegExp. 

    On a side note, on my end, using the latest version of the RadEditor, the style attribute is entirely removed.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top