Invalid parsing result when head/body tag is missing
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start by reproducing the two examples through loadHTML() and compare the HTML5 parser result with DOMDocument. Read the parser path handling omitted html and body start tags, using the linked Mozilla rules as the expected behavior. Done means text before and after the br element is preserved in both examples, with regression coverage.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 122
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Masterminds/html5-php
-
help-wanted
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Masterminds/html5-php#252 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Masterminds/html5-php#251 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Masterminds/html5-php#250 · 5 comments · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
Masterminds/html5-php#246 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Masterminds/html5-php#245 · 1 comment ·
All issues in Masterminds/html5-php
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
microsoft/magentic-ui#588 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
alexgorbatchev/simple-ptt#3 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
CorrelAid/formtransform#44 ·