icon

@sayunu そこらへんのパーサーの挙動はWHATWGの HTML Living Standard 仕様で操作的に定義されているんですよね。

HTML Living Standard 13.2 Parsing HTML documents

そこの Note に、なんでそうなっているのかが書いてあります。

While the HTML syntax described in this specification bears a close resemblance to SGML and XML, it is a separate language with its own parsing rules.

Some earlier versions of HTML (in particular from HTML2 to HTML4) were based on SGML and used SGML parsing rules. However, few (if any) web browsers ever implemented true SGML parsing for HTML documents; the only user agents to strictly handle HTML as an SGML application have historically been validators. The resulting confusion — with validators claiming documents to have one representation while widely deployed web browsers interoperably implemented a different representation — has wasted decades of productivity. This version of HTML thus returns to a non-SGML basis.

Authors interested in using SGML tools in their authoring pipeline are encouraged to use XML tools and the XML serialization of HTML.

昔のHTMLは、仕様上はSGMLによって構文解析ルールが規定されていましたが、SGMLは複雑で、ブラウザーは仕様通りにちゃんと実装することはなかったんですよね。今はHTMLの仕様はSGMLと無関係に仕様が決まっていて、結果的に、昔からのブラウザーの挙動を再現しつつ、ブラウザー間の挙動を統一するものになっています。

icon

@sayunu <p><i><p><b> に該当する例は、特に https://html.spec.whatwg.org/multipage/parsing.html#an-introduction-to-error-handling-and-strange-cases-in-the-parser で述べられているのですが、誤ったマークアップに対する対処として意図的に導入されている挙動のようです。

icon

Twitterって17年しか歴史ないので、推しの子1話の時点ですでにTwitterが日本で普及していると時代感が謎になる

icon

最初が2010年で2話以降がその16年後の2026年とか、それぐらいの時代感になる? 2010年以前なら、フィーチャーフォン(ガラケー)を使ってるのはふつう。