For example, before:
<div> <div>Titles</div> <div>Description</div> </div>
After:
<div>Titles</div> <div>Description</div>
In VS code you can hold opt + cmd or ctrl + alt then use the down and up arrows and the line cursor will duplicate to each line at the position you want. You can then type across multiple lines.
How does it remove the HTML? StripHTML uses a series of PHP functions (such as strip_tags) and some custom made code to remove HTML and ugly formatting. All you have to do is to paste the text, click the button - and voila!
Use the Emmet: Remove Tag
command:
Setup a keybinding for this with editor.emmet.action.removeTag
:
{ "key": "ctrl+shift+k", "command": "editor.emmet.action.removeTag" }
Just a note that there is an improvement in vscode v1.63 to also (as the OP requested) remove the lines on which the removed tags reside. It works now in the Insiders Build. See
Emmet Remove Tag command improvement
The "Emmet: Remove Tag" command now removes empty lines around tags if they are the only tags on the line. It also now does not take into account empty lines when calculating the amount to reindent the lines.
See release notes: emmet remove tag improvements
<div> <- this entire line will be removed sonce only the tag on the line <div>Titles</div> <div>Description</div> </div> <- this entire line will be removed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With