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

[BUG] *.selfClosing doesn't work well #2

Closed
iamwxq opened this issue Nov 10, 2023 · 2 comments
Closed

[BUG] *.selfClosing doesn't work well #2

iamwxq opened this issue Nov 10, 2023 · 2 comments

Comments

@iamwxq
Copy link

iamwxq commented Nov 10, 2023

The rule of *.selfClosing says when I set it to true, the tag will be formatted as <div />.

But actually it will be formatted as <div />, so that there are two space in the tag which one is redundant.

I don't know if it should be like that or it's a bug.

Case following:

input:

<div />
<div></div>

output:

<div  /> <!-- an extra space in the tag -->
<div  />

Here comes my markup config:

"markup": {
    "closingBracketSameLine": true,
    "component.selfClosing": true,

    "formatComments": true,

    "html.void.selfClosing": true,
    "html.normal.selfClosing": true,

    "mathml.selfClosing": true,
    "maxAttrsPerLine": 1,

    "printWidth": 88,

    "svg.selfClosing": true,

    "vBindStyle": "short",
    "vForDelimiterStyle": "in",
    "vOnStyle": "short",
    "vSlotStyle": "short"
}
@iamwxq iamwxq changed the title [BUG] *.selfClosing doesn's work well [BUG] *.selfClosing doesn't work well Nov 10, 2023
@iamwxq
Copy link
Author

iamwxq commented Nov 10, 2023

Ok, now I know the reason why it works like that. Because of the maxAttrsPerLine, when it was set to a number, tag will be formatted as that, and once I set it to null, everything will be ok.

@g-plane
Copy link
Owner

g-plane commented Nov 10, 2023

Thanks for reporting.

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