Repository navigation
A line break inside an HTML table cell keeps the words on either side apart - #1281
Merged
WaylandYang merged 2 commits intoOct 16, 2026
Merged
Conversation
… apart Signed-off-by: dada-yan <BinjunYann@gmail.com>
WaylandYang
approved these changes
Oct 16, 2026
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::grid()reads HTML table cells with dom_query'stext(), which joins text nodes end to end, so words split by a<br>,<p>,<div>or<li>run together unless the source has whitespace between them.Problem
On dev 15fd7d5,
utopia_ingest::parse("page.html", …)readsas
Two readings become one number, the failure #813 fixed in Word cells and #1042 in slide table cells. Every HTML path lifts its tables through
grid():.htmlfiles, whether uploaded, synced or fetched by a URL source (Readability's article or the raw page), feed entries and their linked articles, and MinerU table bodies.Change
grid()reads a cell withformatted_text(), which breaks lines at<br>,<hr>,<li>and block elements but joins inline ones (<b>9</b>50stays950);cleanfolds the breaks into single spaces.Verification
table::tests::a_line_break_inside_a_cell_keeps_the_words_on_either_side_apartcovers<br>in a header and a value,<p>,<div>,<li>and inline<b>. Without the fix it fails, printingDepth(m),NorthField,1020,SouthRidgeand79.grid()): the table above as a short page, inside a long article Readability keeps, and throughfragment_to_markdownreads1020on dev and10 20here.cargo test --locked --workspace1,564 passed, 0 failed, 6 ignored.Limits
display:block<span>) or by tags outside dom_query's list (<center>,<dt>/<dd>) still join.<br>inside a Chinese label now leaves a space (归属于母公司 所有者的净利润), as Word and slide cells already do.