marcus/
lib.rs

1mod helpers;
2mod core;
3use std::collections::HashMap;
4
5// Get a HTML string from a MD file
6pub fn to_string(md: String) -> String {
7  // Read the file's contents
8  let mut html: String = md;
9  // Call parser methods
10  let ignore: HashMap<i32, String> = core::inline_ignore::hide(&mut html);
11  core::escape::default(&mut html);
12  core::comments::default(&mut html);
13  core::emojis::default(&mut html);
14  core::blockquotes::default(&mut html);
15  core::code::default(&mut html);
16  core::emphasis::default(&mut html);
17  core::headings::default(&mut html);
18  core::horizontal_rule::default(&mut html);
19  core::links_images_footnotes::default(&mut html);
20  core::lists_and_task_lists::default(&mut html);
21  core::highlight::default(&mut html);
22  core::strikethrough::default(&mut html);
23  core::subscript::default(&mut html);
24  core::superscript::default(&mut html);
25  core::auto_link::default(&mut html);
26  core::definition_list::default(&mut html);
27  core::table::default(&mut html);
28  core::paragraphs::default(&mut html);
29  core::inline_ignore::show(&mut html, ignore);
30  // Return the output HTML
31  html
32}