DO NOT Format contents in Editor

2 posts, 0 answers
  1. Jeremy
    Jeremy avatar
    1 posts
    Member since:
    Oct 2012

    Posted 15 May 2014 Link to this post


        One of our client want to NOT format the contents when they paste their HTML (in html view). Here is an example. They paste something like this in HTML view

    <table><tr style="background-color:#EEE;"><td>Routes</td><td>200</td></tr></table>

    and when switch to design view and come back (or save), it turns into like this

            <tr style="background-color: rgb(238, 238, 238);">

    Notice that editor not only format the codes (add link breaks etc), but also changes colors to rgb etc. 
    Is there any way to prevent this?
    We are using telerik controls version 2012.2.912.35

  2. Ianko
    Ianko avatar
    1892 posts

    Posted 15 May 2014 Link to this post

    Hello Jeremy,
    The code formatting is done via the IndentHTMLContent content filter and you can disable it with the following line of code:

    The changing of the color is due to teh ConvertToXhtml filter, although I cannot suggest disabling it. This filter is intended to provide valid content and when disabled many of the Editor functionaries could fail.

    Nevertheless, upgrading with the latest version of the Telerik UI for ASP.NET AJAX suite would resolve the issue. On my end using the same content, the color value is correctly preserved as HEX and not replaced to RGB.

    You can do some further testing with this live example.

    Let me know if you need further information on this matter.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top