Vetur: Template/HTML Folding not folding multi line elements properly

Created on 15 May 2019  路  5Comments  路  Source: vuejs/vetur

  • [X] I have searched through existing issues
  • [X] I have read through docs
  • [X] I have read FAQ

Info

Problem

With the following htm (where attributes have been split over multiple lines and closing bracket is on own line)

<div
    class="someclass"
    style="somestyle"
>
   <div class="inner"></div>
   <div class="inner2"></div>
</div>

When trying to fold/collapse the first div, it does not collapse until it's closing </div> tag but only collapses the opening tag and it's attributes. The rest of the inner tags are still exposed...

Basically it ends up looking like:

<div...
   <div class="inner"></div>
   <div class="inner2"></div>
</div>

In a normal HTML file all the inner tags are also folded and hidden and only the start and end tag are visible. eg:

<div...
</div>

Reproducible Case

Very easy to reproduce. Just split multiple attributes of a tag onto their own lines. Then try and fold that element.

bug folding

Most helpful comment

This is related to #2234 and was fixed in #2244

All 5 comments

The closing ">" is in a separate line.

<div
    class="someclass"
    style="somestyle"
>

If I move it up after the last attribute, the folding works as expected.

<div
    class="someclass"
    style="somestyle">

However, the next doc formatting moves it back into a separate line.

Yeah, prettier too. The thing is that a normal html file does not collapse like this. So all I'm saying is it should be consistent.

Vetur now only have indentation based folding: https://github.com/vuejs/vetur/issues/899#issuecomment-435943171.

This becomes possible after #899.

@octref awesome - can't wait 馃槉

This is related to #2234 and was fixed in #2244

Was this page helpful?
0 / 5 - 0 ratings