Skip to content

fix(docx): list marker spacing + audit-driven edge-case coverage#161

Merged
DemchaAV merged 2 commits into
developfrom
fix/docx-list-marker-spacing
Jun 11, 2026
Merged

fix(docx): list marker spacing + audit-driven edge-case coverage#161
DemchaAV merged 2 commits into
developfrom
fix/docx-list-marker-spacing

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

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: ListMarker normalizes value() to carry its own trailing space, and the new list branch from #156 concatenated another literal " " on top. The export now uses the documented ListMarker.prefix() — exactly what the fixed-layout text pipeline uses (TextFlowSupport), so PDF and DOCX agree.

Coverage. Closes the verification gaps the June audit flagged:

  • DOCX semantic export: nested lists indent two spaces per depth, per-depth custom markers survive, lists inside sections export, empty lists are a no-op (3 of these tests fail without the fix above).
  • Pagination: a keepTogether() section taller than a full page still flows across the boundary instead of relocating — the LayoutCompiler capacity guard was implemented but untested.
  • Charts: 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.

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.

DemchaAV added 2 commits June 11, 2026 10:54
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).
@DemchaAV DemchaAV merged commit 40d854a into develop Jun 11, 2026
11 checks passed
@DemchaAV DemchaAV deleted the fix/docx-list-marker-spacing branch June 11, 2026 13:09
@DemchaAV DemchaAV restored the fix/docx-list-marker-spacing branch June 11, 2026 13:10
@DemchaAV DemchaAV deleted the fix/docx-list-marker-spacing branch June 11, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant