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

[html] formatting puts <a> and <button> tags on one line #4409

Closed
4kochi opened this issue Mar 18, 2016 · 1 comment
Closed

[html] formatting puts <a> and <button> tags on one line #4409

4kochi opened this issue Mar 18, 2016 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug html HTML support issues important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@4kochi
Copy link

4kochi commented Mar 18, 2016

  • VSCode Version: 0.10.12-insider
  • OS Version: MacOSX 10.11.3

Steps to Reproduce:

  1. Have some html file
<div>
    <a href="1">1</a>
    <a href="2">2</a>
    <a href="3">2</a>
    <div>
        <p>aaa</p>
        <p>bbb</p>
        <p>ccc</p>
        <div>
            <button>test</button>
            <button>tes2</button>
            <button>tes2</button>
        </div>
    </div>
</div>
  1. Format code
  2. Result looks weird
<div> <a href="1">1</a> <a href="2">2</a> <a href="3">2</a>
    <div>
        <p>aaa</p>
        <p>bbb</p>
        <p>ccc</p>
        <div> <button>test</button> <button>tes2</button> <button>tes2</button> </div>
    </div>
</div>

In Action:

a

Currently tested with <a> and <button> tags. Might affect more tags. <div> and <p> works fine.

Here is my config of the html formt options:

//-------- HTML configuration --------

    // Maximum amount of characters per line (0 = disable).
    "html.format.wrapLineLength": 120,

    // List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all inline tags.
    "html.format.unformatted": null,

    // Indent <head> and <body> sections.
    "html.format.indentInnerHtml": false,

    // Whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text..
    "html.format.preserveNewLines": false,

    // Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.
    "html.format.maxPreserveNewLines": null,

    // Format and indent {{#foo}} and {{/foo}}.
    "html.format.indentHandlebars": false,

    // End with a newline.
    "html.format.endWithNewline": false,

    // List of tags, comma separated, that should have an extra newline before them. 'null' defaults to "head, body, /html".
    "html.format.extraLiners": null
@aeschli aeschli self-assigned this Mar 18, 2016
@aeschli aeschli added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority html HTML support issues labels Mar 18, 2016
@aeschli aeschli added this to the March 2016 milestone Mar 18, 2016
@aeschli
Copy link
Contributor

aeschli commented Mar 18, 2016

Regression from introducing the html formatting options. The default of preserveNewLines used to be true, now false. Changing this back.
Thanks @4kochi !

@aeschli aeschli assigned bpasero and unassigned aeschli Mar 18, 2016
@bpasero bpasero added the verified Verification succeeded label Mar 18, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug html HTML support issues important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants