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

pub fn rst_link_ref(i: &str) -> IResult<&str, (String, String)>

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;
assert_eq!(
  rst_link_ref("   .. _`name`: destination\nabc"),
  Ok(("\nabc", ("name".to_string(), "destination".to_string())))
);

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.