Like Toggle Line Comment, but preserves nested HTML comments.
- The default
Toggle Line Commentcommand will not handle nested HTML comments, trying to outcomment a block of HTML that contains comments itself will result in broken HTML. - This extensions offers the
Toggle nested HTML Commentscommand that will help preserve nested HTML comments by rewriting them first.
This animation explains it best:
- By default the HTML comments are disabled like
<!--becoming<!-#-and-->becoming-#->. - You can change that by defining different replacements in
disabledHtmlCommentStartanddisabledHtmlCommentEnd.
npm install -g vsce
vsce package
code --install-extension vscode-toggle-nested-html-comments-0.0.1.vsix- I'm using the
Emmet: Balance (outward)to get a good starting selection, there's probably some edge cases with selections I am currently not handling properly.
Enjoy!
