TSE is incapable of perfectly syntax hiliting HTML files, because TSE's
syntax hiliting syntax is too limited for that.
That said, I came up with an HTML syntax hiliting solution that works well
for me by rarely giving me hiliting errors.
For me it works much better than TSE's standard HTML syntax hiliting. Your
milage may vary.
https://ecarlo.nl/tse/index.html#html_carlo
Carlo