Repository navigation
An HTML table keeps its caption - #1287
Merged
WaylandYang merged 2 commits intoOct 16, 2026
Merged
Conversation
Signed-off-by: dada-yan <BinjunYann@gmail.com>
WaylandYang
approved these changes
Oct 16, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thank you. Writing the <caption> as its own paragraph without a colon is right: short captions go with every piece of the table, and long ones are written once instead of filling each piece. Checking the page title before the tables come back keeps a caption like "Pricing tiers" from removing # Pricing from every chunk's breadcrumb. Two small follow-ups: the title-row caption in render_rows has the same # of wells problem and could also use as_paragraph, and the escaping test could keep one input per branch (-/+/*, the two fences and 1./2) each share one). Merging.
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.
table::lift_tablesreplaces each rendered table with a placeholder andgrid()reads only row cells, so<caption>is lost.Problem
On dev 6e09e58,
html::fragment_to_markdownreadsas the bare table. Every HTML path lifts tables:
.htmlfiles, feeds, linked articles, MinerU tables. Extraction's table rules take a table's subject and unit from its caption.Change
render_tablewrites the caption as a paragraph before the table, adding no colon. The chunker repeats it in every piece of a split table if at most 200 bytes or ending in a colon.# of wells,~~~ Notes) are escaped, as htmd does.page_to_markdownlooks for the page title in htmd's text before tables return, so a lifted table never suppresses# title, on pages without a caption too: on dev a title row, header or cell repeating the title did, and every chunk lost the title breadcrumb.Verification
an_html_table_keeps_its_caption,a_caption_that_starts_like_markdown_stays_a_paragraphanda_caption_that_repeats_the_page_title_keeps_the_title_headingfail on dev with only the tests added; removing the escaping or the title fix fails only its test.cargo test --locked --workspace1,577 passed, 0 failed, 6 ignored.Limits