Repository navigation
fix(ebook): keep the text of nested tables in TXT and Markdown - #2106
Open
RionHwang0 wants to merge 3 commits into
Open
RionHwang0 wants to merge 3 commits into
RionHwang0 wants to merge 3 commits into
Conversation
PlainTextWriter and MarkdownWriter built a cell's text from its paragraphs only, so a table nested in a cell (HTML, EPUB) vanished from HTML → TXT and e-book → TXT / Markdown. The nested table's text now stays in its outer cell, in reading order: cells separated by a space and rows by " / ".
KnifeLemon
approved these changes
Dec 6, 2026
KnifeLemon
left a comment
Owner
There was a problem hiding this comment.
Thanks. Keeping the nested table's text in its outer cell, with spaces between cells and / between rows, is a sensible single-line form for both writers, and Nesting.Limit already bounds the recursion. A nested table's own caption still isn't written inside the cell; that's fine to leave. Once #2105 is in, I'll merge main, add the CHANGELOG line under 2.6.0 Fixes and merge this after CI is green.
8 of 14 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on#2106) Co-Authored-By: Claude Opus 5.5 <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.
What does this change?
PlainTextWriterandMarkdownWriterbuild a cell's text from its paragraphs only (cell.Blocks.OfType<HParagraph>()). A table nested in a cell is therefore dropped with all its text, on every route that ends in those writers: HTML → TXT, e-book → TXT / Markdown / TXTZ, and translated documents saved as TXT or Markdown.The readers keep such tables: the HTML, DOCX and HWPX readers put them in
HCell.Blocks, andNesting.Limitcaps the depth. The DOCX, HWPX and XHTML writers already write them. Only the two text writers dropped them.Example: a schedule cell that holds
개요and a small 2×2 table (1일차 | 개막식,2일차 | 현장 견학) came out as일정 개요in TXT and| 일정 | 개요 |in Markdown.The nested table's text now stays in its outer cell, in reading order. Its cells are separated by a space and its rows by
/, because a tab or a line break would split the outer table's row in TXT, and a pipe table can't hold either:일정 개요 1일차 개막식 / 2일차 현장 견학| 일정 | 개요 1일차 개막식 / 2일차 현장 견학 |Header cells of the nested table drop
**the same way outer header cells do. Empty paragraphs in a cell no longer add an extra space in Markdown, which TXT already did.Type of change
How was it tested?
dotnet format --verify-no-changesdotnet test, limited to the affected classes:HtmlReaderTests,EbookTests,KepubTests,NestingLimitTests,PdfReaderTests,ConversionBudgetTests, the translation tests and the Markdown tests. 259 passed, 8 skipped. ThreePandocMarkupTestsfail the same way onmainhere, because the local pandoc version differs.HtmlReaderTests.Nested_table_text_reaches_text_and_markdown_from_html_and_epubcovers HTML → TXT, HTML → EPUB → TXT and EPUB → MD. It fails onmainand passes with this change.#2105 (table captions) touches the same two writers in a different place; the two merge cleanly in either order.
Checklist
src/Filee.App/Assets/i18n/*.jsonfiles (none added)THIRD-PARTY-NOTICES.md(none added)CHANGELOG lines (for your CHANGELOG PR):