Last Updated: 26 Sep 2016 10:10 by ADMIN
Created on: 18 Apr 2013 16:04
Category: Editor
Type: Bug Report
RadEditor inserts a BR element to design mode in Firefox and Chrome when ConvertToXhtml filter is turned on
An additional <br /> element is inserted in the editor when the following steps are executed:

1. Make sure ConvertToXhtml filter is turned on.
2. Switch the editor in HTML mode
3. Set the HTML bellow:
<div class="line1">first line of text</div>
<div class="line2">lastlineoftext</div>

4. Switch back to Design mode.
5. View the HTML using Module Manager - Real Time HTML Viewer
Expected HTML:
<div class="line1">first line of text</div>
<div class="line2">lastlineoftext</div>

 Actual HTML:
<div class="line1">first line of text</div>
<div class="line2">lastlineoftext</div><br>


Currently the <br> element cannot be removed from the HTML code of the content. This element exists by design and it is inserted in the editable iframe by the browser. The <br> element is used as a non-breaking line, which means that the following row can be selected and characters can be typed in it. If such element does not exist, the users will be unable to select the first row of the content area and start typing. 

The ConvertToXhtml filter actually removes this element when switched to HTML mode and retrieves it back as a last child of the <body> element, due to the above mentioned reasons. 

If you have issues with the retrieved content via the get_html() method, note that stripped content is returned when the method is used with an argument value "true".

editor.get_html(true) - returns the HTML content, stripped by the set filters.

editor.get_html(false) or editor.get_html() - returns the raw HTML content as it is currently. The same as the editor.get_contentArea().innerHTML property. 
Disable ConvertToXhtml filter in codebehind:
Posted on: 18 Dec 2013 16:06

Thank you for the comments and the feedback. 

As mentioned in the description of this item, this element is important and vital for the normal and expected behavior of the RadEditor control. 

If the encountered problems are not related to the get_html() method, it would be greatly appreciated if you are able to open support tickets and provide more details about the scenarios and your concerns with this feature of the editor. 

We would be glad to assist you with any encountered difficulties related to our products.
Mojtaba Vali
Posted on: 03 Dec 2013 14:24
it caused me so problems!
please fix this.
Joseph Alfano
Posted on: 27 Aug 2013 20:34
This issue is causing problems for us, too.  Any update on when it will be resolved?  Thanks.