[−][src]Function parse_hyperlinks::parser::restructured_text::rst_link_ref
pub fn rst_link_ref(
i: &str
) -> IResult<&str, (Cow<'_, str>, Cow<'_, str>, Cow<'_, str>)>
Parse a RestructuredText link references.
It returns either Ok((i, (link_name, link_destination, link_title))) or
some error. This parser always returns an empty link_title
This parser always returns an empty link_title=Cow::Borrowed("").
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"), 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_ref() for more examples.