Conversation
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>
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.
The
decimalscheme'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::corestrips a trailing period when composing reference text (full and leaf variants), so every exporter agrees with the docx output. It also corrects thelegalscheme'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
decimaloutput 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