FrontSide / Dary-The-Blog

A Blogging Web-App written in Java using the Framework Play.
Other
5 stars 0 forks source link

Post Editor: Problem with certain characters #1

Closed FrontSide closed 54 years ago

FrontSide commented 10 years ago

Certain characters like the single quote >> ' << are not converted from HTML code back to an ASCII character when editing the Post.

That means, the character >> ' << becomes >> &#39 << once we try to edit the Post!

FrontSide commented 10 years ago

Ok this is fiexed now. But not comletely clean. What I do now is to look for HTML-Char-Entities and replace them with the corresponding ASCII character.

str.replace(/&#(\d+);/g, function (m, n) { return String.fromCharCode(n); })

Thanks to http://stackoverflow.com/a/528786/1686904 at this place.

Problem is now that if a user wants to actually display an HTML-Char-Entity this one's converted as well...

FrontSide commented 10 years ago

Not fixed for >>"<< and >>&<< characters