Skip to main content

Module citations

Module citations 

Source
Expand description

The ONE home of citation-marker ([n]) logic (CONTEXT.md: Citation). Scanning, stripping (copy, history), and wikilink conversion (saved answers) all live here; no other module may parse [n].

Structs§

CitationSpan

Functions§

link_sources
Convert [n] markers to [[source_name]] using a names vec addressed by citation number (source_names[n - 1]). A marker whose slot is out of range OR an empty-string sentinel (a citation number with no backing source — a gap) is left untouched, so a stray [n] never becomes a broken wikilink.
scan
Scan text for all [digits] citation markers, returning spans with byte ranges and 1-based indices.
strip
Remove all [n] citation markers from text, tidying whitespace only where markers are removed.