parse

Function parse 

Source
pub fn parse(input: &str) -> Vec<Expression<'_>>
Expand description

Parses the given input string as Discord MarkDown and returns a vector of Expressions

use discord_markdown::parser::{parse, Expression::*};

let ast = parse(
    "> Can someone link the rust website?\n<@123456789123456789> https://www.rust-lang.org"
);

assert_eq!(ast, vec![
    Blockquote(vec![Text("Can someone link the rust website?")]),
    User("123456789123456789"),
    Text(" "),
    Hyperlink("https://www.rust-lang.org", "https://www.rust-lang.org"),
]);