Skip to main content

Module links

Module links 

Source
Expand description

Parsing for links, images, and automatic links.

Implements:

  • Automatic links: <http://example.com> and <user@example.com>
  • Inline links: [text](url) and [text](url "title")
  • Link attributes: [text](url){#id .class key=value}
  • Inline images: ![alt](url) and ![alt](url "title")
  • Image attributes: ![alt](url){#id .class key=value}
  • Reference links: [text][ref], [text][], [text]
  • Reference images: ![alt][ref], ![alt][], ![alt]

Structs§

LinkScanContext
Flags that control which inline spans the link-bracket scanner treats as opaque (so a ] inside them does not terminate the link/image text).

Functions§

emit_autolink
Emit an automatic link node to the builder.
emit_bare_uri_link
emit_inline_image
Emit an inline image node to the builder. Note: alt_text may contain inline elements and should be parsed recursively.
emit_inline_link
Emit an inline link node to the builder. Note: link_text may contain inline elements and should be parsed recursively.
emit_reference_image
Emit a reference image node with registry lookup.
emit_reference_link
Emit a reference link node to the builder. Preserves the original reference syntax (explicit [text][ref], implicit [text][], or shortcut [text]).
emit_unresolved_reference
Emit an UNRESOLVED_REFERENCE node for a Pandoc bracket-shape pattern whose label didn’t resolve. The wrapper covers the original bracket bytes; the inner text recurses through normal inline parsing (with inner-link suppression so a stray inner inline link doesn’t reorder semantics relative to pandoc-native).
try_parse_autolink
Try to parse an automatic link starting at the current position.
try_parse_bare_uri
try_parse_inline_image
Try to parse an inline image starting at the current position.
try_parse_inline_link
Try to parse an inline link starting at the current position.
try_parse_reference_image
Try to parse a reference-style image: ![alt][ref], ![alt][], or ![alt] Returns (total_len, alt_text, label, is_shortcut) if successful.
try_parse_reference_link
Try to parse a reference link starting at the current position.