feat(html): floor a text document's page box at one page height - #657
Merged
Conversation
A text document renders as a single box that grows with its content, so a document shorter than a page produced a sliver of white instead of a page. The page height was discarded outright; it now floors the box as a `min-height`, which leaves anything longer than a page untouched. Only affects `text_document_margin`, so the reference outputs — generated with the default config, which draws no page box for text documents — are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CebbfAJfN4veeUPJXSqqY8
andiwand
commented
Aug 6, 2026
andiwand
enabled auto-merge (squash)
August 6, 2026 17:48
andiwand
disabled auto-merge
August 6, 2026 18:26
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.
🤖 Generated with Claude Code
A text document renders as a single
.odr-page-outerthat grows with its content, soTextHtmlFragmentdiscarded the page height outright. A document shorter than one page therefore came out as a sliver of white rather than a page — visible now that the downstream apps paginate.The height now floors the box instead of being dropped:
Anything longer than a page is unaffected, since
min-heightcan only ever be below the content height there. The other frontends are untouched — slides, drawing pages and PDF pages already emit both dimensions from their real page geometry.New
translate_outer_flowing_page_stylekeeps the "this box flows past its page" rule indocument_style.cppnext to its fixed-size sibling, rather than as apage_layout.height = {}mutation at the call site.Verification
html_document_styleunit tests cover the fixed/flowing/missing-height cases.odr-public/odt/empty.odtwithtext_document_margin = true: emitswidth:8.2681in;min-height:11.6929in;.HtmlOutputTestsfor odt/docx pass. No reference-output regen needed —text_document_margindefaults tofalse, and no committed reference for a text document contains a page box (only odg/odp/ppt/pptx do, and those paths are unchanged).