mathiasbynens / he

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

Invalid character in IE #31

Closed morgante closed 8 years ago

morgante commented 9 years ago

In IE10, I get an error when trying to include he via a Browserify bundle.

The error is:

Invalid character
mergedAssets.min.8516d96.js (5,33406)

Which points to here in he:

"caret",Ç:"caron"
mathiasbynens commented 9 years ago

Which minifier do you use?

morgante commented 9 years ago

UglifyJS

Maprunner commented 9 years ago

I had the same problem, using grunt-contrib-uglify, which itself uses UglifyJS2. It turned out that it wasn't putting quotes around certain characters in the minified file. IE objects to this and raises a "SCRIPT1014: Invalid character" error. Firefox and Chrome are quite happy to process the minified file.

In the end I did an npm update and it is now putting quotes around everything so IE is happy. grunt-contrib-uglify hasn't changed, so it must be one of the dependencies, but unfortunately I'm not sure which one.

stereokai commented 8 years ago

This is probably a non-issue already and can be closed. Can we get a second verification?

mathiasbynens commented 8 years ago

Closing as I cannot reproduce the issue using he.js from this repository.