Sublime Forum

Mark not closed tags in HTML

#1

Well, this is just a idea/suggestion because I don’t exactly know if it exist yet:

Could be great if we had the posibility to mark in red (for example) the opening HTML tags without the corresponding close tag.

Someone knows something about that?

Thanks!

0 Likes

#2

Technically BracketHighlighter can kind of do this. You would have to make sure that angled brackets have a different scope (color) set in the settings than the tag scope has. Then if a ending tag cannot be found, it would highlight the angled brackets differently for the currently selected tag.

You would potentially get false positives since BracketHighlighter is not setup to search an entire file unless it is small (searching the entire file on every selection change can slow things down). But there is a shortcut that searches the entire file on demand, so you could run that if you are in doubts.

If there is real interest in something like this, I may code up a setting that does this better: maybe if an html tag is found but a match has not been found but the entire file has not been searched, than highlight with a maybe color, if the entire file has been searched and a match is not found give a definitive no match color.

0 Likes