mathiasbynens / he

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

Representing `escape()` as `htmlEncode()` #58

Closed sethimcclaine closed 6 years ago

sethimcclaine commented 6 years ago

Your site implies an html encoder, when it is really just escaping characters, not html encoding.

https://mothereff.in/html-entities

mathiasbynens commented 6 years ago

In your interpretation, what does “HTML encoding” mean?

sethimcclaine commented 6 years ago

Encoding Characters that effect html in a way that they can be show in html.

Thread: https://stackoverflow.com/questions/1219860/html-encoding-lost-when-attribute-read-from-input-field

sethimcclaine commented 6 years ago

Additional resources:

https://www.w3schools.com/html/html_entities.asp

http://php.net/manual/en/function.htmlentities.php

mathiasbynens commented 6 years ago

I’m confused… That’s exactly what he.encode() does: https://github.com/mathiasbynens/he#heencodetext-options