Skip to content

Trailing dot on the decimal numbering scheme - #57

Merged
jph00 merged 2 commits into
mainfrom
fasttract
Sep 1, 2026
Merged

Trailing dot on the decimal numbering scheme#57
jph00 merged 2 commits into
mainfrom
fasttract

Conversation

@PiotrCzapla

@PiotrCzapla PiotrCzapla commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

The decimal scheme's level texts become %1., %1.%2., ... so headings render "1.", "1.1.", "2.2.1." — the caption form legal drafting uses. A second commit makes reference text drop the trailing dot: a caption reads "1.2." but a citation reads "Section 1.2".

This is how Word behaves. In the docx path the citation number comes from a REF field, and Word composes it without the level text's trailing punctuation even when the caption carries it. The HTML, markdown, and typst/PDF exporters bake reference text themselves and were rendering the level text verbatim, so the same document cited "Section 1.2." in HTML and "Section 1.2" in Word. This PR adopts Word's behavior in those exporters: Resolver::core strips a trailing period when composing reference text (full and leaf variants), so every exporter agrees with the docx output. It also corrects the legal scheme's pre-existing dotted references ("Exhibit 1." -> "Exhibit 1").

Tests: Rust suite unchanged (32 pass), Python suite 923 pass with the pinned caption/reference strings updated, mdhtml2docx suite 28 pass.

Breaking change for the published crate: bare decimal output gains dots, and reference text loses trailing dots. A per-call {lvlText: numFmt} mapping reproduces the old captions if anyone needs them.

🤖 Generated with Claude Code

PiotrCzapla and others added 2 commits August 31, 2026 10:07
Level texts become '%1.', '%1.%2.', ... so headings render '1.', '1.1.',
the caption form legal drafting uses. In the contracts corpus this form
outnumbers the bare one 699:2 at top level and 253:99 below (the 99 all
from one charter document). HTML/markdown reference text follows the
level text ('Section 1.1.'), matching how 'legal' already renders
'Exhibit 1.'; the docx REF path keeps the dotless mid-sentence form.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A caption reads '1.2.' but a mid-sentence citation reads 'Section 1.2':
Resolver::core strips a trailing period when composing reference text,
for the full and leaf variants alike. This also corrects the legal
scheme's pre-existing dotted references ('Exhibit 1.' -> 'Exhibit 1')
and matches how Word renders REF fields in the docx path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PiotrCzapla
PiotrCzapla marked this pull request as ready for review September 1, 2026 00:01
@PiotrCzapla
PiotrCzapla requested a review from jph00 September 1, 2026 00:04
@jph00
jph00 merged commit f8d71a5 into main Sep 1, 2026
6 checks passed
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.

2 participants