Repository navigation
Open
Labels
Description
Problem
RunningBand.Resolve replaces {page} and {pages} and leaves any other brace text as given. A typo such as
{total} is drawn as text, and nothing reports it. (origin/main 1c61fa6,
src/VellumPdf.Layout/Elements/RunningBand.cs.)
195: /// Any other brace text is left as given. A null template throws
...
201: public string Resolve(int pageNumber, int totalPages) =>
202: Template
203: .Replace("{page}", pageNumber.ToString(...), StringComparison.Ordinal)
205: .Replace("{pages}", totalPages.ToString(...), StringComparison.Ordinal);The behaviour is documented, so this is a missing report, not a hidden one. A caller who types {total},
{Page} or { page } has no way to learn it from the library.
Measured
Measured in the 2026-11-16 handbook research on VellumPdf 2.3.3 (not reproduced for this issue): the footer
Pagina {page} van {total} rendered as Pagina 1 van {total}.
Scope (v2.4: report; refused only in strict mode, which is opt-in)
- At save, report each template that contains a
{name}token other than{page}and{pages}: which band,
which token. Report it once per band, not once per page (the bands resolve per page, see Layout: a running band resolves its whole template on every page, so length costs page count times length #518). - Strict mode throws
InvalidOperationExceptionnaming the band and the token. Default saves and prints the
text as today. Default refusal is 3.0 (Refuse the input 2.3.x only reports: the contract changes a patch cannot make #484). - Literal braces that are not a
{name}token (for example{alone, or JSON-like text) are not reported;
the token grammar is part of the design and is documented onTemplate. - The report uses the diagnostics channel (Layout: one general diagnostics channel and an opt-in strict mode (the additive half of #496 and the channel of #304) #607).
Document.BandTruncations(Document.cs:70) is the
existing precedent for a per-band report.
Acceptance
Pagina {page} van {total}yields one report naming{total};Pagina {page} van {pages}yields none.- Default mode saves with the same bytes as today; strict mode throws.
- A template with two unknown tokens reports both.
- The test fails on origin/main 1c61fa6, proven by mutation.
Relates to
- Layout: a null RunningBand template throws NullReferenceException from Save, not ArgumentNullException #531 (null template), Layout: a running band resolves its whole template on every page, so length costs page count times length #518 (template resolved on every page), Layout: one diagnostics channel, before a third one-off warning type is invented #496, Layout: one general diagnostics channel and an opt-in strict mode (the additive half of #496 and the channel of #304) #607.
Activity