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

format bugs: html attr wrap #77

Closed
beeplin opened this issue Mar 4, 2017 · 8 comments
Closed

format bugs: html attr wrap #77

beeplin opened this issue Mar 4, 2017 · 8 comments

Comments

@beeplin
Copy link

beeplin commented Mar 4, 2017

When vscode settings has "html.format.wrapAttributes": "force", (or force-align), formatting of vue file looks like this:

image
the indentation is all broken.

I am not sure if this is veture's bug or vscode's.

vscode: 1.10.1
veture: 0.4.1
os: windows 10 x64

@beeplin
Copy link
Author

beeplin commented Mar 4, 2017

it turns out that this is due to vetur.

HTML file works OKAY with "html.format.wrapAttributes": "force-aligned":
image

But same code has broken indentations for VUE files:
image

@octref
Copy link
Member

octref commented Mar 4, 2017

Is it that html will also be broken without "html.format.wrapAttributes": "force-aligned"?

vetur like html is using jsbeautify, but I don't want to add too many options. I'm thinking just use force-aligned as default -- will that be OK?

@octref octref added the bug label Mar 4, 2017
@beeplin
Copy link
Author

beeplin commented Mar 5, 2017

the vue template only breaks with force-aligned and force. auto and force-expand-multiline is fine.

As for the second question: I suggest just following vscode's setting of html.format.wrapAttributes:
image

I am not sure why it behaves differently in HTML and Vue files. I suppose vetur is calling the same API as vscode does when doing reformat. Is vscode using jsbeautify too?

@octref
Copy link
Member

octref commented Mar 6, 2017

Closing in favor of #82.

@EliazTray
Copy link

what is your color theme? @beeplin

@beeplin
Copy link
Author

beeplin commented Mar 15, 2017

one dark +

@EliazTray
Copy link

thank you 👍

@newfoeother
Copy link

but i set "force" or "force-aligned" is ok . when i set "force-expand-multiline", the code was broken, and i can't use js-beautify

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

No branches or pull requests

4 participants