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

Disable Filters: ConvertFontToSpan,ConvertToXhtml and FixUlBoldItalic not working as expected in V2014.2.724.40

1 Answer 85 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Brete
Top achievements
Rank 1
Brete asked on 24 Oct 2014, 07:22 PM
I am working on upgrading some sites from   V2013.1.714.40 to V2014.2.724.40 and I am having an issue with the filters:  ConvertFontToSpan,ConvertToXhtml and FixUlBoldItalic


I am calling DisableFilter  on page load, but the filters don't appear to be working the same as  before. 


When I read the RadEditor.Content on server or preview in the HTML window I am getting the following results:


Results in  V2013.1.714.40  (Expected Result) 
This will appear below your profile photo <u>on page 4 of</u> your newsletter. Please include attorne<i>y name(s</i>) and/or the <b>firm n</b>ame, an address, ph<font color="#00b050">one number, e</font>mail address, and your firm website. A maximum of 12 lines are available<br>

Note: The Bolds are <b></b>, the Italic is <i></i>, Underline is <u></u> and the Font is <Font ></font>    

 
Results in  V2014.2.724.40 and V2014.1.403.40
This will appear below your profile photo <span style="text-decoration: underline;">on page 4 of</span> your newsletter. Please include attorne<em>y name(s</em>) and/or the <strong>firm n</strong>ame, an address, ph<span style="color: rgb(146, 208, 80);">one number, e</span>mail address, and your firm website. A maximum of 12 lines are available<br>

Note: The Bolds are now <strong></strong>, the Italic is now <span style="text-decoration: underline;"></span>, Underline is now <em></em> and the Font is now <Font <span style="color: "></span>    




Did something change in the way the filters are used?        


  <telerik:RadEditor ID="RadEditor1" runat="server"  Width="300px"  StripFormattingOnPaste="MSWord, MSWordNoFonts, MSWordRemoveAll, Css, Font, Span"
                                    StripFormattingOptions="MSWord, MSWordNoFonts, MSWordRemoveAll, Css, Font, Span"
           Skin="Default">
                              
                                     <Tools>
                                      <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="Save" Text="Save" />
                                        <telerik:EditorTool Name="Cancel" Text="Cancel" />
                                       
                                        <telerik:EditorSeparator />
                                        <telerik:EditorTool Name="Cut" />
                                        <telerik:EditorTool Name="Copy" />
                                        <telerik:EditorTool Name="Paste" />
                                        <telerik:EditorSeparator />
                                        <telerik:EditorTool Name="Undo" />
                                        <telerik:EditorTool Name="Redo" />
                                        <telerik:EditorSeparator />
                                        <telerik:EditorTool Name="InsertSymbol" />
                                      </telerik:EditorToolGroup>
                                      <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="Bold" />
                                        <telerik:EditorTool Name="Italic" />
                                        <telerik:EditorTool Name="Underline" />
                                        <telerik:EditorTool Name="Subscript" />
                                        <telerik:EditorTool Name="Superscript" />
                                                                                <telerik:EditorTool Name="ForeColor" />
                                        <telerik:EditorSeparator />
                                        <telerik:EditorTool Name="JustifyLeft" />
                                        <telerik:EditorTool Name="JustifyRight" />
                                        <telerik:EditorTool Name="JustifyCenter" />
                                        <telerik:EditorTool Name="JustifyFull" />
                                        <telerik:EditorTool Name="JustifyNone" />
                                      </telerik:EditorToolGroup>
                                      <telerik:EditorToolGroup>
                                        <telerik:EditorTool Name="InsertOrderedList" />
                                        <telerik:EditorTool Name="InsertUnorderedList" />
                                
                                        <telerik:EditorSeparator />
                                        <telerik:EditorTool Name="InsertParagraph" />
                                        <telerik:EditorSeparator />
                                
                                 
                                        
                                        <telerik:EditorTool Name="AjaxSpellCheck" Text="Spell Check" />
                                      </telerik:EditorToolGroup>
                                    </Tools>
                                    <Content>
                                   
</Content></telerik:RadEditor>
 

   protected void Page_Load(object sender, EventArgs e)
    {
        RadEditor1.DisableFilter(EditorFilters.ConvertFontToSpan);
        RadEditor1.DisableFilter(EditorFilters.ConvertToXhtml);
        RadEditor1.DisableFilter(EditorFilters.FixUlBoldItalic);
        RadEditor1.DisableFilter(EditorFilters.MozEmStrong);
 
    }

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 28 Oct 2014, 12:26 PM
Hello Brete,

The described behavior is due to improvements of the inline commands introduced in Q3 2013. This help article explains more on the matter and provides a backward compatibility solution. 

Note that you should also disable the ConvertTags filter to stop the transformation of the <b> to <strong> tags.

This example works fine on my end and achieves the required functionality:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
 
<script type="text/javascript" src="<%= Page.ClientScript.GetWebResourceUrl(typeof(RadEditor), "Telerik.Web.UI.Editor.RadEditor.Commands.LegacyInlineCommands.js") %>"></script>
 
<telerik:RadEditor runat="server" ID="RadEditor1">
    <Content>
        <b>Bold</b><br/><i>Italic</i><br/><u>Underline</u>
        <br/>
        <font color="#00b050">using font and HTML attributes</font>
    </Content>
</telerik:RadEditor>

C#
protected void Page_Load(object sender, EventArgs e)
{
    // retain <b> and <i> tags and stop transformation to <strong> and <em>
    RadEditor1.DisableFilter(EditorFilters.ConvertTags);
    // stop transformation of <u> tags to inline style
    RadEditor1.DisableFilter(EditorFilters.FixUlBoldItalic);
    // stop transformation of <font> to <span>
    RadEditor1.DisableFilter(EditorFilters.ConvertFontToSpan);
}



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
Brete
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or