[][src]Function mrml::to_title

pub fn to_title(input: &str, options: Options) -> Result<String, Error>

generate the title from mjml

use mrml::{to_title, Options};
let result = to_title(r#"
    <mjml>
        <mj-head>
            <mj-title>Something</mj-title>
        </mj-head>
    </mjml>
"#, Options::default());
assert!(result.is_ok());
assert_eq!(result.unwrap(), "Something");
use mrml::{to_title, Options};
let result = to_title("<mjml", Options::default());
assert!(result.is_err());