[−][src]Function parse_hyperlinks::parser::restructured_text::rst_link_ref
pub fn rst_link_ref(i: &str) -> IResult<&str, (Cow<'_, str>, Cow<'_, str>)>
Parse a RestructuredText link references. The parser expects to start at the beginning of the line.
use parse_hyperlinks::parser::restructured_text::rst_link_ref; use std::borrow::Cow; assert_eq!( rst_link_ref(" .. _`name`: destination\nabc"), Ok(("\nabc", (Cow::from("name"), Cow::from("destination")))) );
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_ref() for more examples.
It returns either Ok((i, (link_name, link_destination))) or some error.