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

DO NOT Format contents in Editor

1 Answer 41 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 15 May 2014, 11:58 AM
Hi,

    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

<table>
    <tbody>
        <tr style="background-color: rgb(238, 238, 238);">
            <td>Routes</td>
            <td>200</td>
        </tr>
    </tbody>
</table>

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?
thanks
We are using telerik controls version 2012.2.912.35

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 15 May 2014, 03:15 PM
Hello Jeremy,
 
The code formatting is done via the IndentHTMLContent content filter and you can disable it with the following line of code:
RadEditor1.DisableFilter(EditorFilters.IndentHTMLContent);


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.

Regards,
Ianko
Telerik
 

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.

 
Tags
Editor
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or