htmlvisual-studio-codeemmet

Emmet in VS Code is overwriting text in HTML when using wrap with abbreviation, some kind of bug?


I am experiencing some frustrating behavior from Emmet right now while using VS Code, as far as I am aware Emmet is baked into VS Code (?).

The wrap with abbreviation seems to not be working as expected, seems to clear text that is below my selection and deletes other tags

Below is my starting point

I am trying to wrap the selected text with emmet using wrap with abbreviation(M W), you can see the line breaks have been removed after hitting the hotkeys

After entering ul for the emmet abbreviation I get this, the text has its line breaks back and it has somehow overwritten a part of the next tag.

I then finish the abbreviation with <li> to get my 5 items and I get this, as expected but I have lost a chunk of my element below it. Any ideas?


Solution

  • So I figured it out. I had format on save turned ON. For some reason it clears any line breaks for text that isn't within a tag when the file is saved, which doesn't seem to play ball with Emmet. I turned this setting off and it works perfectly now.