Skip to content

Fix empty bibliography rendering and the index-term leak - #17

Merged
ronaldtse merged 1 commit into
mainfrom
fix/bibliography-rendering
Nov 2, 2026
Merged

ronaldtse merged 1 commit into
mainfrom
fix/bibliography-rendering

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

Validating the rendered documents found every one of them ending at a bare "Bibliography" heading — all entries dropped — plus a stray "Index" section full of garbage terms.

Root causes and fixes:

  1. Empty Bibliography / Normative references sections. The sections lacked the [bibliography] marker, and metanorma silently discards entries without a [[[id,text]]] anchor. All 12 sections across pm-1001..1006 now carry the marker and anchored entries — real relaton fetches for JCGM documents, nofetch(...) for everything else, one anchor per entry (multi-anchor entries render their later displays as empty [] chips).
  2. pm-1006's combined JCGM 100:2008 + Amd.1:2026 citation is not a fetchable docid; now cites the base JCGM 100:2008 with the amendment named in prose (the register convention).
  3. Garbage Index section. AsciiDoc captures ((...)) as index terms even inside backtick code spans, so formula fragments (((n(n+1))/2)^2) leaked into the document index. The affected spans are now stem:[] (math content) or pass:[] (the bare (( token) — verified: the Index section no longer renders at all.
  4. Validator pass (scripts/validate-register.rb): new bibliography checks — missing [bibliography] markers, unanchored entries, multi-anchor entries, unbalanced nofetch( — negative-tested against the pre-fix markup, all three classes caught.

Verified locally: all six documents compile; every bibliography entry renders; no [ ]/NO INFORMATION AVAILABLE chips; no Index section; JCGM anchors parse (JCGM fetches resolve from the local cache; CI fetches live).

Test plan

  • metanorma compile of all six parts — Bibliography sections fully populated, no Index garbage
  • ruby scripts/validate-register.rb — VALIDATION OK (6 documents)
  • Negative test of the new validator pass against deliberately malformed markup — all three defect classes reported
  • Reviewer: spot-check rendered pm-1002 (JCGM normative references) and pm-1006 (split series entries) after Pages rebuild

Every document rendered a bare "Bibliography" heading with all entries
dropped: the sections lacked the [bibliography] marker, and entries
without a [[[id,text]]] anchor are silently discarded by metanorma.
Entries now carry the marker and anchors - real relaton fetches for the
JCGM documents, nofetch() for everything else, one anchor per entry
(multi-anchor entries render their later displays empty).

The stray "Index" section holding garbage terms came from the index-term
capture of ((...)) inside backtick code spans; the affected formula
spans are now stem:[] (math content) or pass:[] (the bare (( token).

The register validator gains a bibliography pass so this defect class
fails CI instead of rendering: missing [bibliography] markers,
unanchored entries, multi-anchor entries, and unbalanced nofetch(
parentheses.
@ronaldtse
ronaldtse merged commit 5d989ce into main Nov 2, 2026
3 of 5 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.

1 participant