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

Nesting <p> tag being created when using Add Paragrah button in IE

2 Answers 50 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Arjun
Top achievements
Rank 1
Arjun asked on 15 Oct 2012, 04:18 AM
When using Add Paragraph button in the HTML editor, if the paragraph is inside a table cell, then we will create some <p> tag nested within another <p> tag. HTML standard doesn't support <p> nested inside another <p> tag. 

Steps to reproduce,


1. Create a 1 cell table, add some text to the table cell in any HTML editor
2. Now select the text and click center align icon , increase the fornt, change the font -> switch to HTML view and you will notice the <p align> being added
3. Go back to the design view -> Click on the empty space between aligned text -> click on "Enter" to go to next line >  Click the Add Paragraph icon twice -> You should have the nested <P> tag. I've put the result HTML code in the comment section.
 

The datatags marked in yellow is nested inside datatag marked in red, this should not be the case.

 This datatag is in IE

<P>

<TABLE>

    <TBODY>

        <TR>

            <TD>

            <P align=left>&nbsp;<SPAN style="FONT-FAMILY: 'Palatino Linotype', 'Book Antiqua', Palatino, serif; FONT-SIZE: 16px">this is my final <BR>

            <P>&nbsp;</P>

            <P>&nbsp;</P>

            <P>&nbsp;</P>

            <P  align=left>text</P>

            </SPAN></P>

            <P align=left>&nbsp;</P>

            </TD>

        </TR>

    </TBODY>

</TABLE>

</P>


The nested P tag is creating random issues in the past and it's creating junk code under some circumstances.  Can we fix this?

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 15 Oct 2012, 02:06 PM
Hi,

It seems that you have disabled the ConvertToXhtml filter of RadEditor. You should enable it so that RadEditor validates and corrects the produced content.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Arjun
Top achievements
Rank 1
answered on 18 Oct 2012, 04:51 AM
Works fine now.

Thanks,
AM
Tags
Editor
Asked by
Arjun
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Arjun
Top achievements
Rank 1
Share this question
or