EpicEditor icon indicating copy to clipboard operation
EpicEditor copied to clipboard

Ampersand inside code ticks gets escaped as `&`

Open sscovil opened this issue 10 years ago • 2 comments

In EpicEditor, when adding a code block like this:

foo&bar

...the result looks like this:

foo&bar

I'm pretty sure GitHub also uses Marked.js as a parser, so I'm guessing this is happening in the export() method?

Animated GIF screenshot

sscovil avatar Jul 02 '14 17:07 sscovil

SOLUTION: In epiceditor.js, change line 197 from this:

return content.replace(/\u00a0/g, ' ').replace(/ /g, ' ');

...to this:

return content.replace(/\u00a0/g, ' ').replace(/ /g, ' ').replace(/\u0026/g, '&').replace(/&/g, '&');

I will put in a pull request shortly.

sscovil avatar Jul 02 '14 20:07 sscovil

:+1: It Rocks !

thx

mistergraphx avatar Dec 08 '14 22:12 mistergraphx