Have you come across HTML code sniffer
http://squizlabs.github.io/HTML_CodeSniffer/