2 ms·
It's a screenscraping protection, too. Documents malformed this way cannot be parsed e.g. with PHP's DOM functions without significant headache.
by mschuster91 10y ago
It's a screenscraping protection, too.
Documents malformed this way cannot be parsed e.g. with PHP's DOM functions without significant headache.
- DasIch 10y agoThese documents aren't malformed they're are perfectly valid HTML5. The problem here isn't the document it's that you don't have a HTML5 parser or that the parser is broken.
- TheRealPomax 10y agoYou seem to misunderstand what's going on here. HTML5 explicitly lists which tags are optional in what context, and the document style presented in the link takes that fact and recommends thus removing any optional tag to save data over the wire. There is nothing "malformed" about this, this is literally doing what the spec says is explicitly valid. Any proper HTML5 parser regardless, of which language its written in or for, should be able to parse HTML5 with optional tags omitted perfectly fine. If PHP's DOM functions don't work for it, then PHP's DOM functions aren't HTML5 spec compliant, and that should be filed as issues against PHP and fixed by its developers.