[][src]Function parse_hyperlinks::parser::restructured_text::rst_link_label2dest

pub fn rst_link_label2dest(i: &str) -> IResult<&str, Link<'_>>

Parse a RestructuredText link reference definition.

This parser always returns an empty link_title as Cow::Borrowed("").

use parse_hyperlinks::parser::Link;
use parse_hyperlinks::parser::restructured_text::rst_link_label2dest;
use std::borrow::Cow;

assert_eq!(
  rst_link_label2dest("   .. _`label`: destination\nabc"),
  Ok(("\nabc", Link::Label2Dest(Cow::from("label"), Cow::from("destination"), Cow::from(""))))
);

Here some examples for link references:

.. _Python home page: http://www.python.org
.. _`Python: home page`: http://www.python.org

See unit test test_rst_link_label2dest() for more examples.