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

Unwanted auto-formatting on snippet insert

2 Answers 36 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Luuk
Top achievements
Rank 1
Luuk asked on 08 Jul 2014, 08:38 AM
I have the following (simplified) snippet defined in my toolsfile:

<snippet name="Test">
    <![CDATA[
        <table cellpadding="0" cellspacing="0" width="100%" style="mso-table-rspace:10pt">
            <tr>
                <td valign="bottom">Image here</td>
            </tr>
            <tr>
                <td bgcolor="#ffffff" style="background-color:#ffffff; font-family:Arial, Helvetica, Sans Serif; font-size:12px; line-height:16px; color:#000000; padding:0 20px;">
                    <a href="#" style="color:#78348c;">Read on &#9658;</a>
                </td>
            </tr>
        </table>
    ]]>
</snippet>

When inserting this snippit, two issues emerge:
  1. The style="mso-table-rspace:10pt" attribute is removed from the table tag
  2. After 'read on' there is a HTML character with code 9658 (which displays an arrow). How ever on insert, the character is not inserted with the character code (like &#9658;), but as the character itself. This renders incorrectly in Outlook. In fact, inserting the above code example here did exactly the same thing.

StripFormattingOnPaste and StripFormattingOptions are both set to none, ContentFilters are set to: RemoveScripts,ConvertFontToSpan,FixUlBoldItalic,IECleanAnchors,FixEnclosingP,ConvertTags,ConvertFontToSpan,OptimizeSpans,IndentHTMLContent.

What else can I do to fix this issue?


2 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 10 Jul 2014, 01:24 PM
Hello Luuk,

Setting the same content filters which you listed, the stripping of the mso-table-rspace:10pt style is not reproducible. If the ConvertToXhtml filter is enabled, then it is stripped, because it is not valid upon XHTML specifications.

You can examine the results on my end with this screencast.

The behavior with the arrow is due to native browser replacement. It is expected browser to replace the entities to characters and if you use the same content in a plain HTML page you will see the same results as in design mode by inspecting the HTML via the browser's dev toolbar.

The RadEditor has a built-in filter that converts character to entities, although such such scenario should be handled with a custom content filter.

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.

 
0
Luuk
Top achievements
Rank 1
answered on 11 Jul 2014, 01:37 PM
Hello Ianko,

Thank you for your elaborate post. It was good to know that with the given content filter it should work. So I dug a little deeper and I found the culprit: someone had also set the content filters programmatically, overruling my content filters. So when I removed that line of code it worked fine. Thanks you!

I'll look into custom content filters soon.

Thanks again!
Tags
Editor
Asked by
Luuk
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Luuk
Top achievements
Rank 1
Share this question
or