question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrap align html attributes only when line reaches certain length

See original GitHub issue

Is 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:open
  • Created 6 years ago
  • Reactions:18
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
Adondrielcommented, Jun 13, 2018

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.

3reactions
RenaldasKcommented, May 30, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found