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

Allow preserving end tag of self-closing element at its own line #2131

Open
TomasHubelbauer opened this issue Jan 24, 2023 · 0 comments
Open

Comments

@TomasHubelbauer
Copy link

Description

I'd like to request an option be introduced to allow preserving a self-closing tag's /> on its own line. This is so that VS Code can re-export this setting to enable doing this in the built-in VS Code HTML formatter. See microsoft/vscode#170796

Input

The code looked like this before beautification:

<input
    placeholder="test"
    
/>

Expected Output

The code should have looked like this after beautification:

<input
    placeholder="test"
    
/>

Actual Output

The code actually looked like this after beautification:

<input
    placeholder="test"
    … />

Steps to Reproduce

  • Go to https://beautifier.io/
  • Switch to Beautify HTML
  • Add "wrap-attributes": "preserve" to custom options
  • Run on the above snippet

Environment

https://beautifier.io

Settings

Custom:

{
  "wrap-attributes": "preserve"
}

Initial on https://beautifier.io:

{
  "indent_size": "4",
  "indent_char": " ",
  "max_preserve_newlines": "0",
  "preserve_newlines": true,
  "keep_array_indentation": false,
  "break_chained_methods": false,
  "indent_scripts": "normal",
  "brace_style": "collapse",
  "space_before_conditional": true,
  "unescape_strings": false,
  "jslint_happy": false,
  "end_with_newline": false,
  "wrap_line_length": "0",
  "indent_inner_html": false,
  "comma_first": false,
  "e4x": false,
  "indent_empty_lines": false,
  "wrap-attributes": "preserve"
}
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

2 participants