Skip to content

Preserve merged DOCX tables as HTML#2224

Open
StaryMoon wants to merge 1 commit into
microsoft:mainfrom
StaryMoon:fix/docx-merged-cell-tables
Open

Preserve merged DOCX tables as HTML#2224
StaryMoon wants to merge 1 commit into
microsoft:mainfrom
StaryMoon:fix/docx-merged-cell-tables

Conversation

@StaryMoon

Copy link
Copy Markdown

Summary

  • preserve DOCX tables containing rowspan or colspan as semantic HTML
  • keep simple DOCX tables in the existing pipe-table Markdown format
  • scope the behavior to DOCX conversion so direct HTML conversion remains unchanged

Why

Pipe-table Markdown cannot represent merged cells. Mammoth already emits the correct span attributes, but markdownify flattens the table and loses the relationship between cells. Keeping only complex DOCX tables as HTML preserves their structure for Markdown renderers and downstream LLM processing.

Tests

  • added regression coverage for row spans, column spans, simple tables, and the direct HTML default
  • 7 passed in the targeted DOCX/HTML test run
  • verified end to end with a generated DOCX containing both horizontal and vertical merged cells

Fixes #20

@StaryMoon

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

Word Document table conversion issue

1 participant