mathiasbynens / he

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

How to download and use in app #57

Closed arc95 closed 6 years ago

arc95 commented 6 years ago

Hi. Thanks for this great library. I'm having a challenge downloading this library and using it directly (not via npm). I downloaded he.js from here but it seems to have other dependencies, as it errors on line 32 with Unexpected token:

var encodeMap = <%= encodeMap %>;

Those % tags look like they belong server side. How do you download this library directly? What am I doing wrong? Thanks.

mathiasbynens commented 6 years ago

You need to use the built version at https://github.com/mathiasbynens/he/blob/master/he.js.

From CDNJS, for example: https://cdnjs.com/libraries/he

arc95 commented 6 years ago

Thank you 👍