-
-
Notifications
You must be signed in to change notification settings - Fork 11
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 to maintain single/multi lines for html attribute #101
Comments
Does #42 help you? If so, add 👍 there. |
No. That issue adds "preferSingleLineOpeningTag" to force single line for single attribute. However, I would like a formatter to maintain the single/multi lines as the original code. That is, I would expect the following results. before: <div class="foo" />
<div
class="foo"
/>
<div class="foo"
id="foo"
/>
<div
class="foo" id="foo"
/> after: <div class="foo" />
<div
class="foo"
/>
<div class="foo" id="foo" />
<div
class="foo"
id="foo"
/> |
@rod24574575 The behavior you are looking for can already be achieved if you have more than one attribute by inserting a newline before the first attr (if you have the setting For ex this will be formatted on a single line: -<div class="foo"
- id="foo"
-/>
+<div class="foo" id="foo" /> But this will be on multiple lines -<div
- class="foo" id="foo"
-/>
+<div
+ class="foo"
+ id="foo"
+/> See playground As for the single attribute use case, see #42 for discussions on the matter. |
I found that this plugin would always format html with single attribute to single line when the line length does not exceed the print-width.
before:
after:
Is there any config to change the behavior to maintain the original single/multi lines status, just like the default behavior of dprint's typescript plugin?
For example, dprint's typescript plugin would not change the format of the following code.
The text was updated successfully, but these errors were encountered: