Sourcesetr logo

HTML Nested Comments

The problem: if your HTML code contains a comment, and you want to add a new comment to temporarily disable a block or portion of code, the built in commenting functionality does not actually place the comment tags in expected locations. If an existing comment is included in the content being commented out, the first instance of a --> closing comment tag will end the entire comment.

example HTML code with comment issues
Sublime Text sample of HTML comment issue.

The solution: The plugin very simply finds all comments within the highlighted block of code and converts dashes to tildes, and then places the comment tags in the expected locations. The plugin also then reverses the effect to uncomment the same code.

example HTML code with comment issue solution
Sublime Text nested comments solution.

This plugin/package/extension is available for: