Skip to content

Format: closing bracked on newline fails with inner text #1649

Closed

Description

@3xau1o

If a xml tag has plain text inside, the closing bracket is inlined instead of setting it on a new line

Current format

<text x="50%"
      y="50%"
      font-size="60"
      > SVG </text>  <!-- Should be newline -->

Desired format

<text x="50%"
      y="50%"
      font-size="60"
      > 
      SVG 
</text>

settings xml.format.closingBracketNewLine is already enabled

{
    "editor.linkedEditing": true,
    "[xml]": {
        "editor.defaultFormatter": "redhat.vscode-xml",
        "editor.tabSize": 2,
        "files.trimTrailingWhitespace": true,
        "files.trimFinalNewlines": true
    },
    "xml.format.preserveEmptyContent": true,
    "xml.format.emptyElements": "collapse",
    "xml.format.splitAttributes": "alignWithFirstAttr",
    "xml.completion.autoCloseTags": true,
    "xml.format.spaceBeforeEmptyCloseTag": true,
    "xml.format.closingBracketNewLine": true,
    "xml.preferences.quoteStyle": "double",
    "xml.fileAssociations": [
        {
            "pattern": "**/*.xml.svg",
            "systemId": ".vscode/svg11-flat-20110816.dtd"
        }
    ],
    "html.autoClosingTags": true,
}

Activity

  1. changed the title [-]Format help: closing bracked on newline[/-] [+]Format: closing bracked on newline fails with inner text[/+] on Jun 18, 2024
  2. added
    formattingThis issue or enhancement is related to formatting support
    on Sep 10, 2026
  3. 26 remaining items

  4. added this to the 0.32.0 milestone on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingformattingThis issue or enhancement is related to formatting support

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions