1

I'm new to Emacs, new to Emmet, and new to Stack Overflow.

I'm trying to wrap a list of text in individual html tags.

Home
About
Something

is supposed to become

<ul>
    <li>Home</li>
    <li>About</li>
    <li>Something</li>
</ul>

Apparently emmet has an abbreviation for this. (Documented here: http://docs.emmet.io/actions/wrap-with-abbreviation/)

Following these instructions, I select my 3 lines of text, hit C-c w to bring up the emmet wrap function, enter ul>li* and hit RET. But instead of the expected

<ul>
    <li>Home</li>
    <li>About</li>
    <li>Something</li>
</ul>

I get

<ul>
    <li></li>
</ul>

I've tried experimenting with the $# placeholder but that didn't help.

Wraping a selected text in a single tag works fine (select text -> C-c w -> p -> RET to create a p-tag with the selected text in it). Creating multiple tags, each with the same text in it also works fine (select text -> C-c w -> ul>li*3 will create a ul with 3 items, each one has the selected text in it).

Supposedly the * operator (without a number) repeats something for each line highlighted, but that doesn't seem to work. Is this feature not available in Emacs' emmet-mode or am I doing something wrong?

4
  • No, I don't think emmet-mode supports this feature. There are a number of differences between emmet-mode and the original Emmet that are not documented. You should write up an issue. – Tianxiang Xiong Sep 4 '16 at 22:57
  • Will do. (As soon as I get home.) – orangeInk Sep 5 '16 at 10:57
  • Issue here – orangeInk Sep 5 '16 at 16:34
  • is this issue resolved? i tried wrapping my text file with html tags and it doesn't work. – Ralph Bacolod Mar 17 '19 at 22:09
0

It's not emmet-mode, but web-mode-surround from web-mode performs the desired function for any tag (it asks for a tag name in the minibuffer)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.