0

I have a html snippet like this:

<body>
  <ul>
    <li>jasmine</li>
    <li>cinthia</li>
  </ul>
</body>

How to wrap the ul element (after selection) inside a div element in web-mode like this,

<body>
  <div>   <!--- inserted via function --->
    <ul>   
      <li>jasmine</li>
      <li>cinthia</li>
    </ul>
  </div>   <!--- inserted via function --->
</body>

I use web-mode for html files.

2

You can use M-x web-mode-element-wrap

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.