Don't drop empty header rows (#175) - #178
Merged
Merged
Conversation
…mpv) - repro.qmd shows the round-trip failure end-to-end (parser is correct, writer corrupts the table). - exp-empty-body-row.qmd confirms the asymmetry is scoped to the header path; body rows of all-empty cells round-trip faithfully. - triage.md localizes the bug to write_table in crates/pampa/src/writers/qmd.rs and documents Pandoc's gfm writer as the reference output. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
) When a Pandoc TableHead has zero rows (the parser output for tables whose header line was all-empty cells), write_table was emitting the first body row as the header line. The re-parser then read that body row as the header, so head$rows flipped from 0 to 1 and the body silently lost a row on every qmd→json→qmd round-trip. Insert a synthetic empty header row when table.head.rows is empty, so the existing header-line code emits "| | |" and every body row stays a body row. Matches pandoc's gfm writer behavior on the same input. Adds tests/roundtrip_tests/qmd-json-qmd/pipe_table_empty_header.qmd; the existing test_qmd_roundtrip_consistency picks it up automatically. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes #175.