Wrap align html attributes only when line reaches certain length
See original GitHub issueIs it possible to only wrap html attributes when line reaches certain length of characters. The way it works in Phpstorm for example is that If I have something like this.
<div v-for="item in items" class="items">
<p>{{item.name}}</p>
</div>
Phpstorm formatter does not wrap the attributes but if my code looks something like this
<div v-for="item in items" class="items" v-if="items.notEmpty()" :class="{active: isActive} :key="item.id">
<p>{{item.name}}</p>
</div>
and line contains more then 100 characters then it will wrap the attributes and align them like so
<div v-for="item in items"
class="items"
v-if="items.notEmpty()"
:class="{active: isActive}
:key="item.id">
<p>{{item.name}}</p>
</div>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:18
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Wrapping and breaking text - CSS: Cascading Style Sheets
This guide explains the various ways in which overflowing text can be managed in CSS.
Read more >Wrap HTML attributes on new lines set by user when ...
Webstorm aligns attributes vertically when they're put on a new line by the user. It will align with the last attribute in the...
Read more >How to wrap table cell <td> content using CSS - GeeksforGeeks
Method 1: Using word-wrap property: The word-wrap: break-word; property is used to break the long word at an appropriate break point. Example:.
Read more >CSS word-break property - W3Schools
... of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML. ... specifies how words should break when reaching...
Read more >Where Lines Break is Complicated. Here's all the ... - CSS-Tricks
Here's all the Related CSS and HTML. ... It's just some of the properties I'm aware of. HTML; SCSS ... Line Wrapping Related...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was thinking an option for something like a “number of attributes before wrapping” would be nice, so I could say, anything with < 4 attributes won’t be wrapped, while anything >= 4 attributes would be wrapped, and that would be configurable per user, of course.
Actually I had a look at #1285 issue and the behaviour described there suits my needs as well, so I think I might fork this PR #1297 instead and try to get it merged and closed.