Large number of CRLFs in HTML

4 posts, 0 answers
  1. Patrick
    Patrick avatar
    17 posts
    Member since:
    Jun 2013

    Posted 05 Aug 2014 Link to this post

    We are using VS 2013 and Telerik version 2014.1.403.40.
    On some occasions we are getting documents in the Telerik RadEditor which when edited are creating large numbers of CRLFs in the HTML code.  Near the top of the document there will be a section which appears to be a comment <!--  followed by thousands of CRLFs with a single line of actual code appearing every 32768 characters. So there are 16392 CRLFs followed by a single line (like /* Font Defintions */) then another 16392 CRLFS and another line of code.  This continues for approximately 250,000 lines until the uncomment line appears -->

    If this is left in the document IE "freezes" indicating a long script is running.  If I remove the extra commented out section the document loads correctly and quickly.  

    These documents are edited within the RadEdit and saved there, they are not pasted from Word or other editing software.  Can you tell me why this gigantic section of commented code is present and how can I keep it from having this issue?  This is happening with both IE11 and IE8

    This is the code for the ASPX page:
                        <td colspan="2">
                            <telerik:RadEditor ID="reContent" ContentAreaMode="Iframe" EditModes="Design,Preview" ToolbarMode="Default" ToolsFile="~/Telerik/ToolsFile.xml" ContentAreaCssFile="EditorContentArea.css" AutoResizeHeight="true" Width="100%" runat="server">
                                <ImageManager MaxUploadFileSize="1000000" EnableImageEditor="true" />
                                <SpellCheckSettings DictionaryPath="~/Telerik/RadSpell" AllowAddCustom="false" SpellCheckProvider="EditDistanceProvider" EditDistance="2" FragmentIgnoreOptions="All" WordIgnoreOptions="UPPERCASE,WordsWithNumbers" />
  2. Ianko
    Ianko avatar
    1507 posts

    Posted 06 Aug 2014 Link to this post

    Hello Patrick,

    You can try to resolve this behavior by disabled in the IndentHTMLContent filter. You can do that in the code behind using this line of code;

    This filter adds multiple characters to modify the HTML content in the HTML mode to a more-readable one.

    If this does not help, please provide a simple project that demonstrates how these characters appear in the content and what are the exact steps leading to this behavior.


    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. DevCraft R3 2016 release webinar banner
  4. Patrick
    Patrick avatar
    17 posts
    Member since:
    Jun 2013

    Posted 06 Aug 2014 in reply to Ianko Link to this post

    Thank you! I will implement that change and test.  
    I will let you know if it helped or not after a week or so of testing.
  5. Patrick
    Patrick avatar
    17 posts
    Member since:
    Jun 2013

    Posted 08 Aug 2014 Link to this post

    Unfortunately that did not resolve the issue.   Due to this issue affecting a large number of users I have had to resort to scrubbing the content before loading and before saving to be sure the content does not become too big.  Currently I am using this code ( :

                        Dim Pattern = "\r\n|\r|\n"
                        Content = Regex.Replace(Content, Pattern, "")
                        reContent.Content = Content

    To remove all the CRLFs that exist and are causing the issue.  I will try to create a small sample project that will demonstrate the problem

Back to Top