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

Disabling ConvertTags filter not working anymore to replace strong with b tag?

2 Answers 30 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 23 Jun 2016, 10:23 PM

I'd like to change the behavior of the Editor from using strong,em tags and instead using b,i.  This is to make our website easier to listen to when using a screen reader.

When I tried removing the ConvertTags content filter, it does not seem to do anything anymore... compared to what all the articles talk about.

I've tested this on your demo site too:  http://demos.telerik.com/aspnet-ajax/editor/examples/builtincontentfilters/defaultcs.aspx

I am using Chrome 51.0.2704.103.

 

2 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 24 Jun 2016, 02:15 PM

I should probably be more clear.  I was under the impression that the buttons for Bold and Italics on the editor would function differently if those filters were off.  It appears that those buttons do not change, but I see that disabling those filters do allow me to manually add the tags for bold/italics.

How do I change the html that the buttons use?

0
Stanimir
Telerik team
answered on 28 Jun 2016, 06:42 AM
Hi Chris,

Thank you for contacting Telerik support.

Here is the easiest way to achieve the required functionality.

1. Do not disable the ConvertTags filter.
2. Add the following javascript code to the page where the editor is loaded:
Sys.Application.add_init(function() {
    var $E = Telerik.Web.UI.Editor;
    $E.BoldCommand().settings.tag = "b";
    $E.BoldCommand().settings.altTags = ["string"];
    $E.ItalicCommand().settings.tag = "i";
    $E.ItalicCommand().settings.altTags = ["em"];
    $E.ConvertTagsFilter.prototype.tags = [
        { target: "b", source: "strong" },
        { target: "i", source: "em" },
        { target: "del", source: "strike" }
    ];
});

I hope this helps.


Regards,
Stanimir
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Editor
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Stanimir
Telerik team
Share this question
or