[][src]Function parse_hyperlinks::parser::markdown::md_link_ref

pub fn md_link_ref(
    i: &str
) -> IResult<&str, (Cow<'_, str>, Cow<'_, str>, Cow<'_, str>)>

Matches a Markdown link reference definition. It returns either Ok((i, (link_label, link_destination, link_title))) or some error.

The caller must guarantee, that the parser starts at first character of the input or at the first character of a line.

use parse_hyperlinks::parser::markdown::md_link_ref;
use std::borrow::Cow;

assert_eq!(
  md_link_ref("   [label]: <destination> 'title'\nabc"),
  Ok(("\nabc", (Cow::from("label"), Cow::from("destination"), Cow::from("title"))))
);