Skip to main content

try_parse_reference_definition

Function try_parse_reference_definition 

Source
pub fn try_parse_reference_definition(
    text: &str,
) -> Option<(usize, String, String, Option<String>)>
Expand description

Try to parse a reference definition starting at the current position. Returns Some((bytes_consumed, label, url, title)) on success.

text may span multiple lines. The destination and title may each be preceded by at most one newline (per CommonMark ยง4.7). Blank lines terminate the definition: callers should stop the input at the first blank line so the parser cannot cross one.

Syntax:

[label]: url "title"
[label]: <url> 'title'
[label]:
  url
  "title"