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

[Solved] Editor inserts paragraphs at random

1 Answer 62 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jeff Paetkau
Top achievements
Rank 1
Jeff Paetkau asked on 11 Jan 2010, 09:51 PM
Hi,

When certain html structures are present the editor will insert <p> tags at random spots.

Steps to reproduce


2) go to HTML mode

3) Delete everything and Paste the following html:

<p><strong><h3>1</h3></strong></p> 
<p>&nbsp;</p> 
<p>2</p> 

4) Go back to design mode

5) Go back to HTML mode and note the code

<p><strong></strong></p
<strong> 
<h3>1</h3> 
</strong> 
<p></p
<p> </p> 
<p>2</p> 


The problem affects at least Chrome and IE. Chrome will only insert 1 additional tag and then stop. If you repeat steps 4 & 5 in IE it will insert an additional <p> each cycle.

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 12 Jan 2010, 02:28 PM
Hi Jeff,

The RadEditor's content area is a standard editable IFrame and it's using the RichText Editing engine of the browser. The mentioned behavior occurs because RadEditor is trying to modify the content to be XHTML1.0 compliant. The provided sample code has inappropriate tag nesting(<h> tag cannot be inside <p> tag) and the multiple nested tags confuses the ConvertToXhtml built-in filter. If you disable this filter you will notice that this behavior will not occur anymore.


Sincerely yours,
Dobromir
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
Jeff Paetkau
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or