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

RadEditor HTML mode displays symbol instead of HTML code

4 Answers 197 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Amy
Top achievements
Rank 1
Amy asked on 02 Aug 2010, 02:52 PM
When using the 'Insert Symbol' drop-down in the RadEditor, some of the symbols display as symbols in HTML mode rather than as HTML code.  For example, after inserting an angle in Design mode I see an angle symbol and in HTML mode I see the corresponding HTML ∠.  However, after inserting a triangle the triangle symbol is shown in both Design and HTML modes.  If I manually enter the equivalent Unicode (△) in HTML mode, switch to Design mode and then back to HTML mode the Unicode is replaced with the actual symbol.  Note, if I manually enter the Unicode for the angle (&#8736) in HTML mode, switch to Design mode and then back to HTML mode the Unicode is replaced with the corresponding HTML code (&ang).

Could someone provide insight as to why this is happening, and any suggestions for how to work around this issue? 

Please let me know if any additional information is needed, thank you!!

4 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 02 Aug 2010, 03:40 PM
Hello Amy,

The ConvertCharactersToEntities filter of RadEditor converts a predefined sets of characters to their entities. Since the angle symbol is part of the list of symbols that this filter converts to entities, this symbol is automatically converted to ∠. The △ is not  part of the ConvertCharactersToEntities filter and the browser automatically converts it to its representing symbol.

The solution is to implement a content filter that will replace the entities with special symbols as shown in this KB article: Converting Unicode symbols to numeric HTML entities using a content filter.

The solution is to implement a content filter that will replace the entities with special symbols as shown in this KB article: Converting Unicode symbols to numeric HTML entities using a content filter.

You could also add new symbols to the current ConvertCharactersToEntities filter: for example to add the infinity symbol the ConvertCharactersToEntities list of symbols attach to the OnClientLoad event of RadEditor and put this line in the OnClientLoad function, e.g.

editor.get_filtersManager().getFilterByName("ConvertCharactersToEntities").entities.infin = '\u221e';

Note that it is possible to add only HTML entities (for example & or ") to the list of entities that will be converted to characters, but not HTML numbers as #

Best regards,
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
0
Amy
Top achievements
Rank 1
answered on 02 Aug 2010, 06:43 PM
Thank you for the quick response!  I implemented the content filter and am able to produce the results needed.  Out of curiosity, will any additional symbols be added to the ConvertCharactersToEntities content filter in future releases of the RadEditor?

0
Rumen
Telerik team
answered on 03 Aug 2010, 01:17 PM
Hi Amy,

For the time being, we do not plan to add new symbols to the ConvertCharactersToEntities filter, because this could decrease the speed of the content editing. You know that the JavaScript based programs are at least 10 times slower that the desktop applications.

Nevertheless, we will consider adding new characters requested by customers - just provide a list of entities that you want to be added.
We have also provide a way to add new entities to the ConvertCharactersToEntities filters list, e.g.

editor.get_filtersManager().getFilterByName("ConvertCharactersToEntities").entities.infin = '\u221e';

If you want to convert HTML numbers to symbols, you can always implement a custom content filter as shown in the provided KB article: Converting Unicode symbols to numeric HTML entities using a content filter.

Kind regards,
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
0
Adam
Top achievements
Rank 1
answered on 03 Feb 2016, 06:00 AM

After reading this, I still need assistance with trying to implement filter that renders the html entity code in the Designer.  For example, if user placed the bullet (•) in Content, I would like Design to render (•).  What I am getting is • in the Design tab.  I have a working customer filter, and using code like b.innerHTML = b.innerHTML.replace(/u2022/g, '&#8226'); is not working.

Your assistance is appreciated.  Thanks.

Tags
Editor
Asked by
Amy
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Amy
Top achievements
Rank 1
Adam
Top achievements
Rank 1
Share this question
or