简体   繁体   中英

Wrap multiple lines of text with different sibling tags in Emmet

Is there a way using Emmet to highlight and wrap the following lines:

This is a title
This is a subtitle
This is the sentence below the subtitle.

So that it would output:

<h2>This is a title</h2>
<h3>This is a subtitle</h3>
<p>This is the sentence below the subtitle.</p>

I've tried:

h2+h3+p

But that outputs:

<h2></h2>
<h3></h3>
<p>This is a titleThis is a subtitleThis is the sentence below the subtitle.</p>

Try this:

h2{This is a title}+h3{This is a subtitle}+p{This is the sentence below the subtitle.}

JS Fiddle: (Just press tab at the end of the line :)

http://jsbin.com/qelenuda/1/edit

No, it's not possible. In this case it's much faster to individually wrap each line instead of struggling with new syntax for single abbreviation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM