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

RadEditor changes html structure

1 Answer 88 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Taylan
Top achievements
Rank 1
Taylan asked on 08 Aug 2011, 09:05 AM
Hi,

we're using RadEditor to edit various html contents in our project. Our requirement is this: We have certain pages with html templates, where the html structure should not change. Only the content (text images etc) should be changed by the users. The problem we have is that some html templates are not full html pages but only internal parts of pages, and they might have structures like

<!-- top image starts -->
<tr>
    <td align="center" valign="top" colspan="3">
        <table width="620" align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0">
...

i.e. the html starts with <tr> or some other tags which should not be the outermost tags in html. What we've observed is that RadEditor changes this html into this:

        <table width="620" align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0">
...

It strips the <tr> and <td> tags and only leaves the <table> tag. We need RadEditor to leave the whole html as it is and not make any changes at all. I've searched the interwebs and checked the RadEditor documentation but I can't find any parameter for RadEditor which does this. Can we have RadEditor leave the html untouched or do we have to find another editor for this purpose?

Best,

Taylan

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 10 Aug 2011, 09:11 PM
Hi Taylan,

Your content is invalid HTML/XHTML and it is the browser which corrects it. The browser validation cannot be stopped and you will experience this problem in our competitors' HTML editors.

The browser's Rich Text Editing engine checks for unclosed and non well formed tags and corrects or try to correct them automatically without providing a way to disable the browser validation. You can verify my words by testing the attached HTML page with an editable IFRAME element in it. You will reproduce the same behavior with an editable DIV element as well as in our competitors' editors.

Kind regards,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Editor
Asked by
Taylan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or