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?

5
  • 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. Commented Sep 4, 2016 at 22:57
  • Will do. (As soon as I get home.)
    – orangeInk
    Commented Sep 5, 2016 at 10:57
  • Issue here
    – orangeInk
    Commented Sep 5, 2016 at 16:34
  • is this issue resolved? i tried wrapping my text file with html tags and it doesn't work. Commented Mar 17, 2019 at 22:09
  • Mark the text and type C-c C-c w
    – user40451
    Commented Apr 29, 2023 at 13:37

1 Answer 1

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 and acknowledge you have read our privacy policy.

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