mathiasbynens / he

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

differences with underscore.string.escapeHtml #21

Closed Yvem closed 10 years ago

Yvem commented 10 years ago

underscore.string has a function escapeHtml https://github.com/epeli/underscore.string#string-functions

jQuery also.

I guess he is more robust (as stated in the intro), but may we have facts ?

How about perfs ? http://jsperf.com/string-escapehtml

mathiasbynens commented 10 years ago

For the most common escapeHTML-like functions you only need to escape a couple of characters, i.e. https://github.com/mathiasbynens/he/blob/78bc2bbc95a82d03bfe02247a110db32cfe5854b/he.js#L34-L50. If this functionality is all you need, you probably don’t need he.

he’s main functionality is something else entirely. See https://github.com/mathiasbynens/he/issues/18#issuecomment-42768379 for more info.

Yvem commented 10 years ago

Thanks for this quick response !