pub fn extract_links(markdown: &str) -> Vec<String> {

    Parser::new(markdown)
        .filter_map(|event| match event {
            Event::Start(tag) => {
                match tag {
                    Tag::Link(url, _title) => Some(vec![url.into_owned()]),
                    _ => None,
                }
            }
            Event::Text(text) => Some(autolink(&text.into_owned())),
            _ => None,
        })
        .flat_map(|e| e)
        .collect()
}
/// Extracts Links from a markdown String
Extracts Links from a markdown String
Extracts Links from a markdown String
pub fn extract_links(markdown: &str) -> Vec<String> {
    Parser::new(markdown)
        .filter_map(|event| match event {
            Event::Start(tag) => {
                match tag {
                    Tag::Link(url, _title) => Some(vec![url.into_owned()]),
                    _ => None,
                }
            }
            Event::Text(text) => Some(autolink(&text.into_owned())),
            _ => None,
        })
        .flat_map(|e| e)
        .collect()
}
pub fn extract_links ( markdown : & str ) -> Vec < String > { Parser :: new ( markdown ) . filter_map ( | event | match event { Event :: Start ( tag ) => { match tag { Tag :: Link ( url , _title ) => Some ( vec ! [ url into_owned ( ) ] ) , _ => None , } } Event :: Text ( text ) => Some ( autolink ( & text . into_owned ( ) ) ) , _ => None , } ) . flat_map ( | e | e ) . collect ( ) }
Extracts Links from a markdown String
Extracts Links from a markdown String
markdown
&str
markdown
&str