Resolve a wikilink-style URL fragment to a 0-based line number in
the given markdown source. Tries, in order:
^block-id reference — matched against the LAST ^id in the
fragment, so combined Heading^id fragments still resolve to
the block (block IDs are unique per file, so we ignore the
heading prefix).
Explicit {#custom-id} block-attribute span on a heading —
mirrors what the curly-bracket-attributes plugin does at
render time (# Foo {#bar} emits <h1 id="bar">), so a
wikilink to #bar resolves to that heading line.
Auto-generated heading slug — produced with
HeadingIdGenerator so anchors like #Setup line up with how
crossnote renders headings without explicit IDs.
Resolve a wikilink-style URL fragment to a 0-based line number in the given markdown source. Tries, in order:
^block-idreference — matched against the LAST^idin the fragment, so combinedHeading^idfragments still resolve to the block (block IDs are unique per file, so we ignore the heading prefix).{#custom-id}block-attribute span on a heading — mirrors what the curly-bracket-attributes plugin does at render time (# Foo {#bar}emits<h1 id="bar">), so a wikilink to#barresolves to that heading line.#Setupline up with how crossnote renders headings without explicit IDs.Returns -1 if no match.