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

inline_script output is lowercase #2989

Closed
agentcooper opened this issue Mar 10, 2018 · 4 comments · Fixed by #2991
Closed

inline_script output is lowercase #2989

agentcooper opened this issue Mar 10, 2018 · 4 comments · Fixed by #2991
Labels

Comments

@agentcooper
Copy link

This is a bug report.

ES5 or ES6+ input?

ES6.

Uglify version (uglifyjs -V)

uglify-es 3.3.9

Command:

~ $ uglifyjs test.js

JavaScript input

const s = '<Script></Script>';

JavaScript output or error produced

const s="<Script><\/script>";

Second script is in lower case. This is a problem for the code dealing with XML.

The output is correct if inline_script option is disabled:

~ $ uglifyjs test.js -b inline_script=false
const s = "<Script></Script>";

Reproducible in https://skalman.github.io/UglifyJS-online/.

@alexlamsl
Copy link
Collaborator

HTML is case-insensitive, so this isn't a bug per se.

If you want to improve this for your XML use case, submit a Pull Request against master.

@Skalman
Copy link
Contributor

Skalman commented Mar 10, 2018

This is not ES6 specific, and I do think that it's a bug:

> echo 'console.log("</SCRIPT>")' | node
</SCRIPT>

> echo 'console.log("</SCRIPT>")' | ./bin/uglifyjs | node
</script>

@alexlamsl
Copy link
Collaborator

@Skalman eww that's not great, especially since this questionable option is on by default.

@alexlamsl alexlamsl reopened this Mar 10, 2018
@alexlamsl alexlamsl added the bug label Mar 10, 2018
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Mar 10, 2018
Also disable option by default as per documentation.

fixes mishoo#2989
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Mar 10, 2018
Disable option by default as per documentation.

fixes mishoo#2989
alexlamsl added a commit to alexlamsl/UglifyJS that referenced this issue Mar 10, 2018
@Skalman
Copy link
Contributor

Skalman commented Mar 10, 2018

questionable option

I think it's completely reasonable, since it allows you to insert any script into a <script> tag.

Thanks for fixing the bug!

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

Successfully merging a pull request may close this issue.

3 participants