HTML error recovery
The HTML parser's standard rules for repairing broken markup, such as unclosed tags, instead of refusing to show the page.
In more detail
Unlike XML or JSON, which stop at the first syntax error, HTML parsing never fails. The standard spells out exactly how every mistake is fixed, so all browsers build the same DOM from the same broken page.
Related terms
- HTML parser — The part of the browser that reads HTML text and builds the DOM tree from it, one token at a time.
- tree construction — The parsing stage that takes tokens from the tokenizer and assembles them into the DOM tree, tracking which elements are still open.
- XML — A text format that stores structured data as nested elements marked with tags in angle brackets, readable by both people and programs.
Taught in
- HTML Parsing, Tokenization And The Document Object Model (DOM) — Frontend Architecture & Web Platform