Emmet缩写产生多个<a> from existing urls

时间:2018-06-01 10:48:32

标签: html css emmet

this urls as:

www.google.com
www.yahoo.com
www.instagram.com
www.github.com

are in my editor and i want to make some li and a from them form example:

<ul>
    <li><a href="www.www.google.com" target="_blank">www.yahoo.com</a></li>
    <li><a href="www.instagram.com" target="_blank">www.instagram.com</a></li>
    <li><a href="www.github.com" target="_blank">www.github.com.com</a></li>
</ul>

with this emmet snippet:

ul>li*4>a[href="http://www.$#.com" target="_blank"]{http://www.$#.com}

but it doesnt work correctly and i get this output:

<ul>
    <li><a href="http://www.www.google.com
www.yahoo.com
www.instagram.com
www.github.com.com" target="_blank">http://www.www.google.com
        www.yahoo.com
        www.instagram.com
        www.github.com.com</a></li>
    <li><a href="http://www.www.google.com
www.yahoo.com
www.instagram.com
www.github.com.com" target="_blank">http://www.www.google.com
        www.yahoo.com
        www.instagram.com
        www.github.com.com</a></li>
    <li><a href="http://www.www.google.com
www.yahoo.com
www.instagram.com
www.github.com.com" target="_blank">http://www.www.google.com
        www.yahoo.com
        www.instagram.com
        www.github.com.com</a></li>
    <li><a href="http://www.www.google.com
www.yahoo.com
www.instagram.com
www.github.com.com" target="_blank">http://www.www.google.com
        www.yahoo.com
        www.instagram.com
        www.github.com.com</a></li>
</ul>

1 个答案:

答案 0 :(得分:2)

试试这个

ul>li*>a[href=$# target="_blank"]{http://$#}

当您选择了文本

时,无需为乘数添加数字

有关Here

的更多信息