[][src]Function parse_hyperlinks::parser::html::html_link_text2dest

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

Parse an HTML inline hyperlink.

It returns either Ok((i, (link_text, link_destination, link_title))) or some error.

The parser expects to start at the link start (<) to succeed.

use parse_hyperlinks::parser::Link;
use parse_hyperlinks::parser::html::html_link_text2dest;
use std::borrow::Cow;

assert_eq!(
  html_link_text2dest(r#"<a href="destination" title="title">name</a>abc"#),
  Ok(("abc", Link::Text2Dest(Cow::from("name"), Cow::from("destination"), Cow::from("title"))))
);