emacs-evil/evil-surround

Keep attributes when changing tag

tam5 opened this issue · 1 comments

tam5 commented

Vim surround keeps the html/xml attributes of the previous surrounding tag, while optionally removing the attributes if the prompt is ended with >.

From the doc:

If t or < is used, Vim prompts for an HTML/XML tag to insert. You may specify
attributes here and they will be stripped from the closing tag. If replacing a
tag, its attributes are kept in the new tag. End your input with > to discard
the those attributes. If <C-T> is used, the tags will appear on lines by
themselves.

Any suggestions on how to implement?

that's a reasonably complex feature. I think you have to read the whole source code to wrap your head around the logic.