We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The HTML type attribute seems to break JavaScript beautification.
The code looked like this before beautification (note the double spaces surrounding the + operator):
+
<script> console.log(1 + 1) </script> <input type="submit">
The code should have looked like this after beautification (only single spaces surrounding the + operator):
The code actually looked like this after beautification (identical to the input):
$ printf "<script>\n\ > console.log(1 + 1)\n\ > </script>\n\ > \n\ > <input type=\"submit\">\n" | html-beautify <script> console.log(1 + 1) </script> <input type="submit">
Changing the type attribute produces the desired result:
type
$ printf "<script>\n\ console.log(1 + 1)\n\ </script>\n\ \n\ <input type2=\"submit\">\n" | html-beautify <script> console.log(1 + 1) </script> <input type2="submit">
OS: Arch Linux js-beautify version: 1.8.9
{}
The text was updated successfully, but these errors were encountered:
Ugh. Good bug, thanks. https://github.com/beautify-web/js-beautify/blob/master/js/src/html/beautifier.js#L144 is wrong.
Sorry, something went wrong.
Correctly handle type attribute on non-script tags
9543507
Fixes beautifier#1606
68f6494
No branches or pull requests
Description
The HTML type attribute seems to break JavaScript beautification.
Input
The code looked like this before beautification (note the double spaces surrounding the
+
operator):Expected Output
The code should have looked like this after beautification (only single spaces surrounding the
+
operator):Actual Output
The code actually looked like this after beautification (identical to the input):
Steps to Reproduce
Changing the
type
attribute produces the desired result:Environment
OS: Arch Linux
js-beautify version: 1.8.9
Settings
The text was updated successfully, but these errors were encountered: