[][src]Function parse_hyperlinks::parser::first_hyperlink

pub fn first_hyperlink(i: &str) -> Option<(String, String, String)>

Searches for hyperlinks in the input text and returns the first finding as tuple: Some((link_name, link_destination, link_title)) The function recognizes hyperlinks in Markdown or RestructuredText format. ReStructuredText's anonymous links are not supported.

use parse_hyperlinks::parser::first_hyperlink;
let i = "abc\n   [u]: v \"w\"abc";

let r = first_hyperlink(i);
assert_eq!(r, Some(("u".to_string(), "v".to_string(), "w".to_string())));