Curly quotes and the diff engine

4 posts, 0 answers
  1. Matt
    Matt avatar
    10 posts
    Member since:
    Oct 2010

    Posted 13 Jun 2011 Link to this post

    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.
  2. Rumen
    Admin
    Rumen avatar
    13804 posts

    Posted 16 Jun 2011 Link to this post

    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.

  3. Matt
    Matt avatar
    10 posts
    Member since:
    Oct 2010

    Posted 16 Jun 2011 Link to this post

    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.
  4. Rumen
    Admin
    Rumen avatar
    13804 posts

    Posted 20 Jun 2011 Link to this post

    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.

Back to Top