Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Invalid parsing result when head/body tag is missing

オープン
#166 コメント 17 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php
領域
backend

調査の方向性

まず、loadHTML() を通じて2つの例を再現し、HTML5 パーサーの結果を DOMDocument と比較します。リンク先の Mozilla のルールを期待される動作として使用し、省略された html および body の開始タグをパーサーのパスがどのように処理するかを確認します。両方の例で br 要素の前後のテキストが保持され、回帰テストのカバレッジがあることが完了条件です。

索引モデルが issue の本文から書いたものです。

説明

bug

Consider this:

<html>Hello, This is a test.<br />Does it work this time?</html>

Imo, this is valid HTML and it is also parsed correctly by DOMDocument. However, HTML5 parser will ignore the first line of text. We're using loadHTML() method.

Even this one works with DOMDocument:

Hello, This is a test.<br />Does it work this time?

According to Mozilla documentation:

  • html: The start tag may be omitted if the first thing inside the element is not a comment.
  • body: The start tag may be omitted if the first thing inside it is not a space character, comment, <script> element or <style> element.

Reference: https://github.com/roundcube/roundcubemail/issues/6713#issuecomment-480320339

主要言語
HTML
スター
1.8k
フォーク
122
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Masterminds/html5-php のほかの issue

Masterminds/html5-php の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。