fix(docx): list marker spacing + audit-driven edge-case coverage#161
Merged
Conversation
ListMarker normalizes value() to carry its own trailing space, and the semantic list branch concatenated another literal space on top - every exported item read "- text" and markerless lists gained a stray leading space. The export now uses ListMarker.prefix(), matching the fixed-layout text pipeline. Regression tests pin the contract: nested items indent two spaces per depth, per-depth custom markers survive, lists inside sections export, empty lists are a no-op.
Pins behavior the June audit flagged as unverified: grouped bars with negative values anchor at the nice floor and label the negative tick, stacked bars skip non-positive segments, a one-point smooth/area line keeps its marker and value label, long category labels stay slot-sized, a bottom legend in tight width keeps every entry, all-negative NiceScale ranges keep negative bounds, and a keepTogether() section taller than a full page flows across the boundary instead of relocating (the LayoutCompiler capacity guard).
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
Fix. Every list item in the semantic DOCX export rendered with a double space after the marker (
"• text"), and markerless lists gained a stray leading space:ListMarkernormalizesvalue()to carry its own trailing space, and the new list branch from #156 concatenated another literal" "on top. The export now uses the documentedListMarker.prefix()— exactly what the fixed-layout text pipeline uses (TextFlowSupport), so PDF and DOCX agree.Coverage. Closes the verification gaps the June audit flagged:
keepTogether()section taller than a full page still flows across the boundary instead of relocating — theLayoutCompilercapacity guard was implemented but untested.NiceScaleranges keep negative bounds.Tests
./mvnw verify -pl .— 1220 tests, 0 failures (+11 new). No snapshot baselines changed.Notes
Known follow-up (not in scope): DOCX nested items without explicit markers fall back to the list's top-level marker, while the PDF layout applies the per-depth cascade (• → ◦ → ▪) — fidelity gap documented in the test.