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

Editor Inserts unwanted <p> tags

1 Answer 126 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 29 Mar 2010, 04:52 PM
Hi There,

I am having an issue where everytime I switch back and forth from html view and design view, empty <p> tags are being added.  The first time I switch back and forth it adds <p>&nbsp;</p> and everytime after that it adds <p></p>.  So if I switch back and forth 4 times I get.

<p>&nbsp;</p>
<p></p>
<p></p> 
<p></p>

Does anyone know why this is happening and how to fix it?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 31 Mar 2010, 12:16 PM
Hi Dan Swayze,

You can get this error if you edit non well formed HTML content and switch between the Html and Design modes of RadEditor.

The Rich Text Editing engine of the browser that RadEditor's content area IFRAME uses, tries to validate the non well formed content and the <p> tags in it but without success and produces new non valid XHTML content.

This invalid XHTML content misleads the ConvertToXhtml content filter of RadEditor and the editor starts to produce extra paragraphs with every switch between Html and Design mode or when submitting the content. To stop this behavior you can disable the ConvertToXhtml filter

RadEditor1.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertToXhtml);

or instruct your users to validate the content before submitting it using the W3C validator dialog of RadEditor and manually correct it.


Regards,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Mike
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or