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

Large number of CRLFs in HTML

3 Answers 54 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 05 Aug 2014, 05:56 PM
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:
                <tr>
                    <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" />
                        </telerik:RadEditor>
                    </td>
                </tr>

3 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 06 Aug 2014, 12:39 PM
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;
RadEditor1.DisableFilter(EditorFilters.IndentHTMLContent);

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.

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.

 
0
Patrick
Top achievements
Rank 1
answered on 06 Aug 2014, 12:59 PM
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.
0
Patrick
Top achievements
Rank 1
answered on 08 Aug 2014, 03:53 PM
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 (vb.net) :

                    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

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