Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collapseWhitespace option adds unwanted spaces to javascript strings #513

Closed
antelle opened this issue Feb 28, 2016 · 2 comments
Closed

Comments

@antelle
Copy link

antelle commented Feb 28, 2016

$ npm install html-minifier@1.2.0
$ ./node_modules/.bin/html-minifier --remove-comments --collapse-whitespace app.html -o min.html && cat min.html | grep -oh '...<?xml'
 ' <?xml

Original file and result attached.
Contents before:

<!DOCTYPE html>
<html>
<head lang="en">
    <script   >
var xml = '<?xml version="1.0" encoding="utf-8"?>'
</script>
</head>
</html>

Contents after:

<!DOCTYPE html><html><head lang="en"><script>var xml = ' <?xml version="1.0" encoding="utf-8"?> '</script></head></html>

v1.1.1 was ok

Archive.zip

@alexlamsl
Copy link
Collaborator

Fixed by #509

<!DOCTYPE html><head lang=en><script>var xml="<?xml version="1.0" encoding="utf-8"?>"</script>

@antelle
Copy link
Author

antelle commented Feb 28, 2016

Thank you! Please push a new release to npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants