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

[Solved] RadEditor - Removing <BR> tag when i save

1 Answer 249 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Trevor
Top achievements
Rank 2
Trevor asked on 15 Jan 2010, 04:33 PM

When I am in the rad editor I hit enter to place a line space between a table and an image.
When I postback to the server the
Me.RadEditor.Content
removes the <BR> tag.

Here is what I start off with:

<TABLE>
<TR><TD>&nbsp;</TD></TR></TABLE>
<P align=center><BR><IMG style="WIDTH: 393px; HEIGHT: 236px" src="http://www.domain.com/client_images/11/8ball.gif" width=381 height=279></P>

 

 

 

Here is what I end up with when i post back.

<TABLE>
<TR><TD>&nbsp;</TD></TR></TABLE>
<P align=center><IMG style="WIDTH: 393px; HEIGHT: 236px" src="http://www.domain.com/client_images/11/8ball.gif" width=381 height=279></P>

The rad editor also removes this tage when i switch from source view to design view.

Please advise.

Trevor

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 15 Jan 2010, 04:41 PM
Hi Trevor,

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>

Greetings,
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
Trevor
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Share this question
or