Skip to content

fix(xlsx/xls): skip completely empty sheets that emit broken tables - #2488

Open
yi111 (Yi-111-a) wants to merge 1 commit into
microsoft:mainfrom
Yi-111-a:fix/issue-2470
Open

yi111 (Yi-111-a) wants to merge 1 commit into
microsoft:mainfrom
Yi-111-a:fix/issue-2470

Conversation

@Yi-111-a

Copy link
Copy Markdown

Summary

  • Skip sheets where DataFrame.columns.empty in both XlsxConverter and XlsConverter, so a completely empty worksheet no longer emits malformed table markdown (|\n| |).
  • Header-only sheets (which still have columns) continue to render as a well-formed empty table.
  • Add tests for completely empty sheets, header-only sheets, and an all-empty workbook.

Fixes #2470

Test plan

  • packages/markitdown/tests/test_xlsx_empty_sheet.py passes
  • A workbook with one data sheet and one blank sheet no longer includes the blank sheet heading or broken table syntax
  • Header-only sheets still produce a valid empty markdown table

@Yi-111-a

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.

XLSX/XLS: a completely empty sheet emits malformed table syntax under its heading

1 participant