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

Customize HTML Tags

1 Answer 106 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Joe Joseph
Top achievements
Rank 1
Joe Joseph asked on 06 May 2010, 10:15 PM
I would like to customize the Rad Editor to allow only certain HTML tags.
In particular, those tags supported by Adobe Flash player, as mentioned in this web page:

Examples:
As of now, when the user makes a text bold, the HTML code that is produced by the editor has <strong> tag; instead of this tag, the editor should produce, <b> tag in the HTML code, whenever the user clicks the button B in the editor.

Similarly, instead of <em>, the editor should produce <i> in the HTML code, whenever the user clicks the I button.
Instead of <span style="text-decoration: underline;">Underlined Text</span>, it should produce <u>Underlined Text</u>.
In the same way, all the tags mentioned in the above web page - and only those tags - should be supported by the custom Rad Editor.

How do I customize the Editor in this way?

Thanks in advance. I appreciate your help in this.
Regards!

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 11 May 2010, 01:16 PM
Hi Joe,

One of the main goals of RadEditor is to produce valid XHTML content and for this reason the FixUlBoldItalic filter converts the <b> to <strong> and <u> to <span style="text-decoration: underline;"> tags.

My suggestion is to disable this filter by following the instructions in this KB article: Content Filters.

If you want to convert the <em> tags to <i> tags then you should write a custom content filter. See this KB article for an example of a custom content filter that replaces characters with regular expressions: Converting Unicode symbols to numeric HTML entities using a content filter.

Another approach is to replace the tags on the server. The content returned by the Content property is a string, which you can modify with the String.Replace method.


Sincerely yours,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Joe Joseph
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or