RadEditor HTML mode displays symbol instead of HTML code

5 posts, 1 answers
  1. Amy
    Amy avatar
    106 posts
    Member since:
    Aug 2010

    Posted 02 Aug 2010 Link to this post

    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!!
  2. Answer
    Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 02 Aug 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Amy
    Amy avatar
    106 posts
    Member since:
    Aug 2010

    Posted 02 Aug 2010 Link to this post

    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?

  5. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 03 Aug 2010 Link to this post

    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
  6. Adam
    Adam avatar
    1 posts
    Member since:
    Feb 2014

    Posted 03 Feb Link to this post

    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.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017