3 ms·
I didn't think there was just one HTML Parser?
by xupybd 5y ago
I didn't think there was just one HTML Parser?
- chrismorgan 5y agoHTML parsing is exhaustively defined in terms of state machines (with the two main ones being a tokeniser and a tree builder), so that all implementations of it will produce identical results for each given input. It is therefore reasonable to speak of “the HTML parser”. (Actually, this isn’t true in the presence of scripting because of document.write(), which allows you to feed arbitrary data to the parser during parsing. But that’s mostly a technicality.)