This is a migrated thread and some comments may be shown as answers.

Remove parsing on nested double-quotes

1 Answer 244 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dom
Top achievements
Rank 1
Dom asked on 29 Dec 2014, 03:48 PM
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

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 05 Jan 2015, 07:41 AM
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.

 
Tags
Editor
Asked by
Dom
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or