Skip to content

fix: preserve section boundaries in multiline headers - #84

Open
peaceroad wants to merge 1 commit into
redbug312:mainfrom
peaceroad:fix/multiline-header
Open

peaceroad wants to merge 1 commit into
redbug312:mainfrom
peaceroad:fix/multiline-header

Conversation

@peaceroad

Copy link
Copy Markdown

Summary

  • retain the logical row token after multiline-row compaction
  • restore the missing thead_close token for multiline headers
  • add an HTML regression fixture
  • add direct token-order and open/close balance assertions

When a multiline header is compacted, trToken continues to refer to the discarded final physical-row token. The following separator therefore places the group-closing flag on that discarded token instead of the retained logical row. As a result, the rendered table can open tbody before closing thead.

Reassigning trToken to the retained token after compaction preserves the section boundary.

Validation

  • the regression fixture confirms that thead_close occurs before tbody_open
  • thead, tbody, and tr open/close token counts remain balanced
  • existing multiline, rowspan, headerless, and multibody fixtures pass
  • all 56 tests pass with markdown-it 13.0.2
  • coverage remains at 100%
  • lint passes

Fixes #69.

This pull request was prepared with assistance from GitHub Copilot (GPT).

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.

Multiline in table header

1 participant