Skip to content

fix: preserve table rows with omitted end tags - #322

Open
DahanItamar wants to merge 2 commits into
taoqf:mainfrom
DahanItamar:fix/implied-table-end-tags
Open

DahanItamar wants to merge 2 commits into
taoqf:mainfrom
DahanItamar:fix/implied-table-end-tags

Conversation

@DahanItamar

Copy link
Copy Markdown

Fixes #302.

HTML tables may omit cell, row, and section end tags. The parser currently leaves those elements open across the next row or section, so later rows become descendants of earlier cells and can disappear from table queries.

This change closes the applicable cells and rows when a table section ends, and unwinds all applicable optional end tags when the next row or section starts. Nested tables keep their own rows, and preserveTagNesting retains its existing behavior.

The work is split into two commits: closing section boundaries, then handling successive rows and sections. Twenty regression cases cover the reported table, section transitions, nested tables, uppercase tags, and parser options.

Validation:

  • Build passed (bun run compile).
  • Full suite passed on Node 22, 24, and 26: 294 passing, 13 existing pending.
  • Regression file formatting and git diff --check passed.
  • ESLint could not initialize with the locked TypeScript installation (typescript.versionMajorMinor is undefined); the build and test checks above completed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing closing tags

1 participant