How to decode/replace all charCodes with characters in a string using javascript?

12 views Asked by At

I am using wiris editor within TinyMCE editor in one of my projects.

For some reason I want to replace all charCodes used in content with just character, I know that I can do it for every character 1 by 1 like:

str.replace("&", "&");
str.replace(">", ">");

but content contains hundreds of symbols and I don't want to replace all characters manually. Is there a way to filter the string and replace every charCode with its respective character? e.g. replace <math xmlns="http://www.w3.org/1998/Math/MathML"><mo>&#38;</mo></math> with <math xmlns="http://www.w3.org/1998/Math/MathML"><mo>&</mo></math>

0

There are 0 answers