TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Browser from Scratch: HTML Parsing

14 点作者 _xivi将近 2 年前

1 comment

tannhaeuser将近 2 年前
WHATWG's procedural HTML parsing spec sucks big time indeed. Ian Hickson, as the original author, once derived it from how SGML parses HTML, with empty elements and inferring omitted end-tags when encountering block-level markup within span-level markup and all, modulo the commenting oddities introduced to stop browsers rendering CSS and JS as content, and also handling attribute short forms. Once precisely capturing SGML, the spec wasn't updated consistently as new elements were introduced, precisely because of its presentation as explicit redundant enumeration of elements forcing certain others to close or open seemingly at random. I have absolutely no idea how one can be motivated to implement HTML parsing from WHATWG's description, or how one can seriously see it as an improvement over SGML.
评论 #37033990 未加载