Is there a way to highlight unmatched HTML tags in Notepad++?
For instance, if I had the following HTML...
<HTML>
<!--Server: <%=(java.net.InetAddress.getLocalHost()).getHostName()%>-->
<HEAD>
<TITLE>Vital Stats</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<SCRIPT SRC="vital_stats.js" TYPE="text/javascript"></SCRIPT>
<LINK REL="STYLESHEET" HREF="../main.css">
</HTML>
I would like the <HEAD>
tag to be highlighted in some way to indicate that it doesn't have a corresponding </HEAD>
tag.
I would also like to see any closing tags highlighted that don't have a corresponding opening tag.
EDIT
I already know about Notepad++'s feature of clicking a tag to see it's corresponding tag. I'm looking to highlight ANY tags that aren't matched in the ENTIRE document. Even if there's some sort of utility/plugin that I could run that would list for me the line number and name of any unmatched tags would be helpful.
I've put in a request for someone to develop a plugin to do this in Notepad++ at https://sourceforge.net/projects/notepad-plus/forums/forum/331753/topic/4936812
Until that happens, it appears that this cannot be done in Notepad++.
It's highlighted. Click on the tag and you can see:
Tags which are pair open-close are highlighted (violet). Tags without pair aren't highlighted.
There is also red line on the margin which leads to the closing tag. If there is no closing tag you can see that it leads to nowhere.
Below are images - first shows valid situation, second - invalid.
(My Notepad++ version is 5.9.5 on Windows and choosed language is HTML)
For the big file I was working on, my workaround to find the extra/missing div was to rename a copy of the file to file.java. Then replace "/div" with } and "div" with {.
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