Repository navigation
fix(formats): CSV cells read as literal values, blank rows kept (#110, #112) - #120
Merged
Merged
Conversation
`csv::to_table` ran every cell through the inline Markdown parser, so a spreadsheet value such as `*literal*` came back as an italic `literal` and `[a](b)` as a link. Writing the table out again lost the characters (AlienTechSoftware#110). A cell is now one plain span holding its value as written. Fixes AlienTechSoftware#110 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CSV reader skipped every line whose one cell was blank, which also dropped a blank row of a one-column table, so every row under it moved up (AlienTechSoftware#112). The writer now quotes a blank cell that is alone on its row, and the reader keeps a line that held a quoted cell. Lines with nothing on them are still skipped. Fixes AlienTechSoftware#112 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
Closed
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.
What and why
Fixes #110 and #112, both in the CSV reader that GridCraft read-back uses (
table_from_gridcraft_csv). They touch the same lines ofcsv::to_table, so they're one PR in two commits rather than two PRs that would conflict.#110: cells were read as Markdown.
to_tableran every cell throughmarkdown::parse_inline, so a spreadsheet value*literal*became italicliteraland[a](b)became a link. Exporting the table again lost the characters. A cell is now one plainSpanholding its value as written, or no span for an empty cell, which is the same shape the Markdown table parser gives an empty cell. The page writer already escapes literal text (#92), so these values also survive a page save.#112: blank rows of a one-column table were dropped. The reader skipped any line whose single cell was blank. That skipped real blank rows too, and every row under them moved up. Now:
from_tablequotes a blank cell when it's the only cell on its row (""), so the line isn't emptyrows_ofrecords whether a line had a quoted cell, andto_tablekeeps such a linenothing_in_nothing_outcases behave as they didHow it was checked
a_cell_that_looks_like_markdown_is_read_as_it_is_written: four inputs full of Markdown punctuation are read with no marks and written back character for charactera_blank_row_of_a_one_column_table_is_kept: a one-column table with an empty and a whitespace-only row round-trips exactly, and spreadsheet-style""rows among blank lines read as expectedcargo test -p notecraft-formats: 73 passedgridcraft_csv_read_back_preserves_quoted_cells_and_adds_columnsand the UI testa_table_is_read_back_from_the_spreadsheet_beside_the_pagepasscargo fmt --all -- --check,cargo clippy -p notecraft-formats --all-targets -- -D warnings: clean🤖 Generated with Claude Code