PHP 8 has an actual HTML5 parser now. Who’d have thought? This kind of thing (I guess) is better late than never. There are so many things that I can go back to now and simplify the hell out of.