1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
extern crate unicode_categories;
extern crate typed_arena;
extern crate regex;
#[macro_use]
extern crate lazy_static;

mod parser;
mod arena_tree;
mod scanners;
pub mod html;
pub mod cm;
mod ctype;
mod node;
mod entity;
mod entity_data;
mod strings;
mod inlines;
#[cfg(test)]
mod tests;

pub use typed_arena::Arena;
pub use arena_tree::Node;
pub use node::{AstCell, Ast, NodeValue};

pub use parser::{parse_document, ComrakOptions};

pub fn markdown_to_html(md: &str, options: &ComrakOptions) -> String {
    let arena = Arena::new();
    let root = parse_document(&arena, md, options);
    html::format_document(root, options)
}