-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Weird Formatting in VSCode #1475
Comments
Please try this on http://jsbeautifier.org/ which is running the latest rc4. |
@bitwiseman I ran beautify over this in VS Code, both with the beautify file and beautify selection (with various segments selected) and can't reproduce the described behaviour. Could be a user settings issue. Feel free to move this to https://github.com/HookyQR/VSCodeBeautify (Still requires further info - VS Code user settings, |
@bitwiseman @HookyQR I've found one user setting causing this problem.
When the value is true, it seems ok. When the value is set to be false, the formatting result will have the weird style that I described above. |
In my opinion, But I'm likely to be wrong, and that the intention isn't like this at all. |
@bitwiseman I met the same issue both on Windows 10 and the latest OS X High Sierra. |
So if you happen to have the I don't think this is actually a bug. Also I have had much better results with the default settings coming from vscode on the new rc releases rather than 1.7.5 |
You can test to see if what I'm saying is relevant to what your seeing @TianxinTse by taking the indentation out of the second meta tag, if it doesn't indent the meta then it's probably what I'm saying. If it does maybe what I said isn't relevant to what your seeing. |
@RiFi2k InputThe code looked like this before beautification:
Current OutputThe code actually looked like this after beautification:
Expected OutputThe code should have looked like this after beautification:
EnvironmentBrowser User Agent: Language Selected: SettingsExample: {
"indent_size": "2",
"indent_char": " ",
"preserve_newlines": false,
"content_unformatted": [
"meta"
]
} |
Problem Description
Here is an example:
If the last child element has no closing tag, like
<meta>
, formatting the document above will produce:If the last child element does have a closing tag, like
<title>
, formatting the document above will produce:Env
VSCode Version: 1.25.1
OS Version: Windows 10 Version 1803
Installed Related Extensions: Beautify
Steps to Reproduce:
Open any html files.
Use the shortcut to format the document.
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: