mathiasbynens / he

A robust HTML entity encoder/decoder written in JavaScript.
https://mths.be/he
MIT License
3.43k stars 255 forks source link

useNamedReferences doesn't work for all characters #74

Open carolinex opened 5 years ago

carolinex commented 5 years ago

While setting useNamedReferences to true and encodeEverything to true, the character / is encoded as / but the character \ is encoded as \ The same happens with the hyphen/minus character, which is encoded as -

var entity = he.encode(html, {
          useNamedReferences: true,
          encodeEverything: true
})