Module
marksy/links
src/marksy/links.pookaBrackets name the label; parentheses carry its address. This reader keeps them apart so punctuation in a URL does not become inline formatting. Nested parentheses are counted, and malformed links leave their source untouched for the ordinary text reader.
API reference
class Target(
label: String,
destination: String,
title: String,
rest: List(String)
)
label: String
Stringdestination: String
Stringtitle: String
Stringrest: List(String)
List(String)
fn(String, String, String, List(String)) -> marksy/links.Targetclass Definition(label: String, destination: String, title: String)
label: String
Stringdestination: String
Stringtitle: String
String
fn(String, String, String) -> marksy/links.Definitionclass DefinitionRead(value: Definition, lines: Int)
value: Definition
marksy/links.Definitionlines: Int
Int
fn(marksy/links.Definition, Int) -> marksy/links.DefinitionReadread(chars: List(String)) -> Option(Target)
fn(List(String)) -> Option(marksy/links.Target)Input begins just after [. Read a direct link without definitions.
read_with(chars: List(String), definitions: List(Definition)) -> Option(Target)
fn(List(String), List(marksy/links.Definition)) -> Option(marksy/links.Target)Full/collapsed reference links take precedence over shortcut links. A syntactically valid but unknown full label does not fall back to a shortcut.
normalise(value: String) -> String
fn(String) -> StringThe original label spelling matters: backslash escapes are not decoded for matching. Collapse whitespace and fold case, keeping the first definition.
lookup(definitions: List(Definition), label: String) -> Option(Definition)
fn(List(marksy/links.Definition), String) -> Option(marksy/links.Definition)definition(source: String) -> Option(DefinitionRead)
fn(String) -> Option(marksy/links.DefinitionRead)Read one reference definition at the beginning of a nonblank block. The block pass supplies normalised logical lines, including a final newline.
decode_literal(value: String) -> String
fn(String) -> StringDecode only escapes/entities, as required by destinations and fence info.