3 ms·
> Because document markup is much more robust against small errors and probably remains readable while your code likely just crashes? Exactly. The parser is de
by cush 3y ago
> Because document markup is much more robust against small errors and probably remains readable while your code likely just crashes?
Exactly. The parser is designed to parse documents, not code. The document has a structure (like sections, paragraphs, tables, etc). When the structure doesn’t quite make sense, the parser still displays the content (the blog, story, words, etc).
> But was this worth it, could better tooling not have achieved the same with good error messages helping to fix errors?
You need to think about compatibility, especially backwards compatibility. If the standard was so strict that any error resulted in the browser rejecting to parse the document, then as the specification evolved every website would need to be updated. The lack of constraints around standards also means that different browsers can evolve and implement different features at different cadences.