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

[Solved] Editor Inserts <br> as Default Content

1 Answer 114 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Zach
Top achievements
Rank 1
Zach asked on 03 Feb 2010, 12:12 AM
I've recently discovered an issue that has come up on all of our projects that use the Editor.  For some reason, at first load of an editor, there is <br> tag just sitting in the HTML view.  This becomes an issue when dealing with required field validation.  I've tried to uncover where this is coming from by looking at your examples, but the only Editor I could find on there with no content was calling in the Skin "BasicSetOfTools."  As far as I'm aware this was not an issue until we started using the AJAX version of the tools.  I'm attaching our typical Editor code, hopefully this is a simple property that I need to set to stop the stupid br tag from getting inserted at initial load.
<telerik:RadEditor runat="server" SkinID="SettingProperties" ID="uxStoryHTML"
</telerik:RadEditor> 
 

Skin file:
<telerik:RadEditor runat="server" SkinID="SettingProperties" ContentFilters="MakeUrlsAbsolute" StripFormattingOptions="All"
    <DocumentManager SearchPatterns="*.doc,*.docx,*.pdf,*.xls,*.xlsx" DeletePaths="~/uploads/docs/" UploadPaths="~/uploads/docs/" ViewPaths="~/uploads/docs/" MaxUploadFileSize="10240000" /> 
    <ImageManager ImageEditorFileSuffix="*.gif,*.jpg,*.jpeg,*.png,*.bmp" DeletePaths="~/uploads/images/" UploadPaths="~/uploads/images/" ViewPaths="~/uploads/images/" MaxUploadFileSize="604800" /> 
    <MediaManager SearchPatterns="*.avi,*.mpeg,*.mp3,*.wma,*.wav,*.wmv,*.mpg,*.mov" DeletePaths="~/uploads/videos/" UploadPaths="~/uploads/videos/" ViewPaths="~/uploads/videos/" MaxUploadFileSize="5242880" /> 
    <FlashManager SearchPatterns="*.flv,*.swf" DeletePaths="~/uploads/flash/" UploadPaths="~/uploads/flash/" ViewPaths="~/uploads/flash/" MaxUploadFileSize="1024000"/> 
    <TemplateManager SearchPatterns="*.htm,*.html" /> 
    <CssFiles> 
        <telerik:EditorCssFile Value="~/CSS/cms.css" /> 
    </CssFiles> 
    <Tools> 
        <telerik:EditorToolGroup> 
            <telerik:EditorTool Name="AjaxSpellCheck" /> 
            <telerik:EditorTool Name="FindAndReplace" /> 
            <telerik:EditorTool Name="Copy" /> 
            <telerik:EditorTool Name="Paste" /> 
            <telerik:EditorTool Name="PasteFromWord" /> 
            <telerik:EditorTool Name="PasteFromWordNoFontsNoSizes" /> 
            <telerik:EditorTool Name="PastePlainText" /> 
            <telerik:EditorTool Name="PasteAsHtml" /> 
            <telerik:EditorTool Name="Undo" /> 
            <telerik:EditorTool Name="Redo" /> 
            <telerik:EditorSeparator Visible="true" /> 
            <telerik:EditorTool Name="ImageManager" /> 
            <telerik:EditorTool Name="DocumentManager" /> 
            <telerik:EditorTool Name="LinkManager" /> 
            <telerik:EditorTool Name="Unlink" /> 
        </telerik:EditorToolGroup> 
        <telerik:EditorToolGroup> 
            <telerik:EditorTool Name="JustifyLeft" /> 
            <telerik:EditorTool Name="JustifyCenter" /> 
            <telerik:EditorTool Name="JustifyRight" /> 
            <telerik:EditorTool Name="JustifyFull" /> 
            <telerik:EditorTool Name="JustifyNone" /> 
            <telerik:EditorSeparator Visible="true" /> 
            <telerik:EditorTool Name="Indent" /> 
            <telerik:EditorTool Name="Outdent" /> 
            <telerik:EditorTool Name="InsertOrderedList" /> 
            <telerik:EditorTool Name="InsertUnorderedList" /> 
            <telerik:EditorSeparator Visible="true" /> 
            <telerik:EditorTool Name="ConvertToLower" /> 
            <telerik:EditorTool Name="ConvertToUpper" /> 
            <telerik:EditorSeparator Visible="true" /> 
            <telerik:EditorTool Name="InsertTable" /> 
            <telerik:EditorTool Name="InsertSymbol" /> 
        </telerik:EditorToolGroup> 
        <telerik:EditorToolGroup> 
            <telerik:EditorTool Name="FormatStripper" /> 
            <telerik:EditorTool Name="FormatBlock" /> 
            <telerik:EditorTool Name="ApplyClass" /> 
            <telerik:EditorTool Name="Print" /> 
            <telerik:EditorTool Name="Superscript" /> 
            <telerik:EditorTool Name="Subscript" /> 
            <telerik:EditorTool Name="InsertParagraph" /> 
            <telerik:EditorTool Name="InsertHorizontalRule" /> 
            <telerik:EditorTool Name="InsertDate" /> 
            <telerik:EditorTool Name="InsertTime" /> 
            <telerik:EditorTool Name="AboutDialog" /> 
            <telerik:EditorTool Name="Help" /> 
        </telerik:EditorToolGroup> 
    </Tools> 
    <Modules> 
        <telerik:EditorModule Name="RadEditorStatistics" /> 
        <telerik:EditorModule Name="RadEditorDomInspector" /> 
        <telerik:EditorModule Name="RadEditorNodeInspector" /> 
    </Modules> 
</telerik:RadEditor> 

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 05 Feb 2010, 03:30 PM
Hi Zach,

This is a standard browser behavior which can be observed in the Built-in Content Filters Demo - disable all the content filters, select all the content and delete it and then switch to HTML View. Internet Explorer wraps the content in a <p> tag, Firefox inserts a <br>, Chrome inserts an empty <div>.
By design, the built-in content filter ConvertToXhml clears this empty tag.

I noticed that you have ContentFilters="MakeUrlsAbsolute" in your skin file declaration - this will disable all the default built-in filters and will enable only MakeUrlsAbsolute (which is disabled by default). If this is intentional I would suggest you to create a custom content filter to clear this empty tag, otherwise, in order to enable all of the built-in filters (including MakeUrlsAbsolute) the value applied to ContentFilters property should be "DefaultFilters,MakeUrlsAbsolute", e.g.:
<telerik:RadEditor runat="server" SkinID="SettingProperties" ContentFilters="DefaultFilters,MakeUrlsAbsolute" StripFormattingOptions="All">
</telerik:RadEditor>

You can find information how to create a custom content filter in the following help article:
Content Filters

I hope this helps.

Regards,
Dobromir
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Editor
Asked by
Zach
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or