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

[Solved] disappearing line breaks

1 Answer 154 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Igor Kalders
Top achievements
Rank 1
Igor Kalders asked on 13 Jan 2010, 04:39 PM

I keep having problems with disappearing line breaks.

For instance, in a empty project with the latest RadEditor in IE8:

In html mode write this:

<p>first line</p>    
<p>second line </p>   

In design you'll get

first line     
    
second line   

Place your cursor on the third line before the word "second" and press enter 3 times for instance.
This will result in this code in html view:

<p>first line</p> 
<><br /> 
<br /> 
second line </p> 

If you then switch between design and html view over and over, every time one <br /> will dissapear!

Why is this?!

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 18 Jan 2010, 08:05 AM
Hi Igor,

The observed behavior when toggling between Design and Html mode is due to the content optimization RemoveExtraBrakes filter of RadEditor which strips all extra brakse inside some tags like p, h1, etc.
To disable this behavior, please, put the following javascript code after the RadEditor declaration:

<telerik:radeditor runat="server" ID="RadEditor1"></telerik:radeditor>
<script type="text/javascript">
Telerik.Web.UI.Editor.RemoveExtraBrakes.prototype.getHtmlContent = function(content)
{
    return content;
}
Telerik.Web.UI.Editor.StripJunkFilter.prototype.getHtmlContent = function(content)
{
    return content;
}
</script>

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Igor Kalders
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or