Cleanup you html files with SublimeTidyHTML. Parse your files with W3C's tidy-html5 locally. No php required nor webservice call.