Masterminds / Masterminds/html5-php
Tables parsing issue - with <tr> inside <tr> case
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 122
- PR merge metrics
- No merged PRs in 30d
Description
When working with code generated by Microsoft Outlook I found a case where DOMDocument based parser has no problem with specific code, but HTML5 parser does.
The minimal test case input is this:
<table id="t1">
<tr>
<td>
<table id="t2">
<tr>
<tr>
<td></td>
</tr>
</tr>
</table>
</td>
</tr>
<tr><td></td></tr>
</table>
Note the <tr> element as a child of another <tr>. This causes HTML5 parser to output:
<table id="t1">
<tr>
<td>
<table id="t2">
<tr></tr>
<tr>
<td></td>
</tr>
</table>
</td>
</tr>
</table>
<tr><td></td></tr>
Which obviously is invalid and causes the parent table to be "closed" before it should, leaving the next (here: last) tr element outside of the table.
Reference: https://github.com/roundcube/roundcubemail/issues/7356
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.
Research direction
Start by reproducing the minimal nested-table input in the HTML5 parser and compare its output with the expected table structure shown in the issue. Trace the parser’s handling of a encountered inside another , then add coverage for this case and confirm that the final remains inside the parent table.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, php
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100