Prevent RadEditor from closing tags

4 posts, 1 answers
  1. David Kalsbeek
    David Kalsbeek avatar
    3 posts
    Member since:
    Mar 2008

    Posted 09 Mar 2011 Link to this post

    I've got two RadEditors collecting static content to put above and below some data driven content that will wind up rendering out on the page like

    << content from RadEditor1 >>
    << data driven content >>
    << content from RadEditor2 >>

    I'd like to allow a <div> or <table><tr><td> to be left open in RadEditor1 to be followed by </div> or </td></tr></table> in RadEditor2 (this would be entered in the HTML view of the editor).

    I've tried setting the ContentFilters to None and the RadEditor automatically closed the tags. So RadEditor HTML would start with <table><tr><td> and when I switch to the designer and back to HTML I now see <table><tbody><tr><td></td></tr></tbody></table>. 

    Is is possible to force RadEditor to not fix the HTML for me?

    Thanks for your help!
  2. Answer
    Rumen avatar
    12782 posts

    Posted 09 Mar 2011 Link to this post

    Hello David,

    It is not supported by the Rich Text Editing engine of the browser to have only an opening <div> or another tag or only a closing </div> tag in the content area. Every HTML tag is a node in the DOM and it should have an opening and closing tag, in other case the content will be invalid HTML/XHTML.

    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.

    Best regards,
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft R3 2016 release webinar banner
  4. JDs
    JDs avatar
    1 posts
    Member since:
    Aug 2015

    Posted 26 Aug 2015 in reply to Rumen Link to this post

    Are non well formed tags and html still not able to go uncorrected? The html fully gets changed if one thing in the html is incorrect and forces us to figure out what our html was before the editor "attempted" to fix the non well formed html.
  5. Ianko
    Ianko avatar
    1507 posts

    Posted 28 Aug 2015 Link to this post


    As Rumen has explained in his post, the functionality that corrects malformed HTML is a browser technology which is not optional and cannot be disabled.

    RadEditor has nothing to do with that logic and therefore, it cannot control it.

    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 Feedback Portal and vote to affect the priority of the items
Back to Top