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

pub fn html_link(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;
use std::borrow::Cow;

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