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

Curly quotes and the diff engine

3 Answers 63 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 13 Jun 2011, 08:58 PM
Is it possible for the diff engine to see “this” and  “this” as the same text? There are instances where certain methods of uploading documents that may contain curly quotes or other symbols will be sanitized to things like “ and ”, since curly quotes can cause so many problems.

I attempted to look into the documentation (http://www.telerik.com/help/aspnet-ajax/n_telerik_web_ui_editor_diff.html) but it seemed a little lacking. See attached picture for clarification of what I mean.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 16 Jun 2011, 10:47 AM
Hello Matt,

Could you please try to replace the “ symbol with “ and ” with ” before firing the set_initialContent() function, e.g.

function setContent() {
    //Sets editor's current content as initial
    var editor = $find('<%= RadEditor1.ClientID%>');
    editor.set_html(editor.get_html(true).replace(/\“/gi, "&ldquo;").replace(/\”/gi, "&rdquo;"));
    editor.set_initialContent();
}

This solved the problem on my end.


All the best,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Matt
Top achievements
Rank 1
answered on 16 Jun 2011, 02:55 PM
The doesn't really resolve the problem. Here is the full scenario:

  1. A user uploads an html file that contains curly quotes into our application.
  2. A user makes a new revision of that file and then opens it in the RadEditor.
  3. RadEditor replaces the curly quotes with &rdquo; or whatever.
  4. They click the compare button and the files look different because the original file that they are comparing to (the one they uploaded and never opened in the editor) and the file they are working on (in the editor) look identical but have differnet html for the curly quotes.

I understand that when invoking the diff engine I could run the replace to swap in the proper &rdquo; or whatever but there are a ton of symbols that could potentially be swapped into their web-safe counterparts by the editor and it seems to me like the diff engine should handle that.

For a symbol reference see http://www.w3schools.com/tags/ref_symbols.asp. I'm not sure which of these the editor swaps out, but there are a lot of them.
0
Rumen
Telerik team
answered on 20 Jun 2011, 01:12 PM
Hi Matt,

Could you please disable the ConvertCharactersToEntities content filter of RadEditor and test your scenario again? This filter converts reserved characters to their HTML entity names.

All the best,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Editor
Asked by
Matt
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Matt
Top achievements
Rank 1
Share this question
or