Skip to main content

Module refs

Module refs 

Source
Expand description

Link- and footnote-reference tables. CM 4.7 + 6.3 + GFM footnotes require a two-pass parse: first walk the token stream to harvest all definitions, then resolve [label] / [text][label] / [label][] references against the table during the main parse.

Structs§

RefMap
Lookup table built once per parse.

Functions§

normalize_label
CM 4.7: case-insensitive comparison, internal whitespace collapsed to single spaces, leading/trailing whitespace trimmed. Backslash escapes resolve before comparison so [Foo\]] and Foo] match.
parse_link_ref_def
Parse the raw lexeme of a LinkRefDef token into (label, url, title). Returns None on malformed input; the lexer already validated the gross structure ([label]: plus a non-empty destination), so failures here mostly mean a missing ] or :.

Type Aliases§

LinkRef
Resolved link reference: destination URL plus optional title.