Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Tables parsing issue - with <tr> inside <tr> case

Open
#200 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
html, php
Domain
backend, web-dev

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.

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

Dominant language
HTML
Stars
1.8k
Forks
123
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Masterminds/html5-php

All issues in Masterminds/html5-php

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.