mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.41k stars 410 forks source link

expand expression without proper output #498

Open yufeiluo opened 3 years ago

yufeiluo commented 3 years ago

I want to expand the expression :

ul.nav>(li.logo>img)+(li>a)*2

My expectation output is as below:

    <ul class="nav">
        <li class="logo"><img src="" alt=""></li>
        <li><a href=""></a></li>
        <li><a href=""></a></li>
    </ul>

Why the real expanded output is as following:

    <ul class="nav">
        <li class="logo"><img src="" alt=""></li>
        <li><a href=""></a></li>
        <li class="logo"><img src="" alt=""></li>
        <li><a href=""></a></li>
    </ul>
yomotherboard commented 3 years ago

Adding a ^ to make your expression:

ul.nav>(li.logo>img)+^(li>a)*2

It seems to me that grouping is not working correctly. After a group is complete the compiler should "climb up" (as with the ^ operator), but it isn't. I suppose a temporary fix could be to use the ^ operator as necessary to "climb up" any levels created by > operators in a grouping.