Reputation: 578
for some reasons I need to save the > and < symbols AS IS in my TinyMCE 4.2.2 editor instance.
I know I can set the entity_encoding to raw but, while this option prevent most symbols to be translated to entities, "greater than" and "less than" always get converted to <
and >
Does anyone knows if a special flag or option is available for that?
Best regards.
Upvotes: 3
Views: 3418
Reputation: 989
I had this exact question since I want to treat the content of the TinyMCE editor as XML that possibly contains child elements. So if there's a <sub>3</sub>
in the editor field, I want to treat that as an XML element, not just some text. Anyway, this is something that TinyMCE just doesn't allow for. The TinyMCE 4.x docs state several times that:
The base entities < > & ' and " will always be entity encoded into their named equivalents. Though ' and " will only be encoded within attribute values and < > will only be encoded within text nodes. This is correct according to the HTML and XML specifications.
See here and here. There's also some old discussion here about this on the TinyMCE help forums.
The conclusion is that TinyMCE does not allow you to get unescaped less-than or greater-than symbols so you must convert them back from HTML entity codes after you get the text back from TinyMCE.
Upvotes: 2