This commit is contained in:
parent
a3416544f1
commit
21961c505a
38
src/main.rs
38
src/main.rs
|
@ -18,7 +18,9 @@ fn main() {
|
|||
.find(binding_markdown.as_str())
|
||||
.expect("Can't find key value map in markdown");
|
||||
|
||||
markdown = re_key_value.replace(markdown.clone().as_str(), "").to_string();
|
||||
markdown = re_key_value
|
||||
.replace(markdown.clone().as_str(), "")
|
||||
.to_string();
|
||||
|
||||
let mut key_value: HashMap<&str, &str> = HashMap::new();
|
||||
|
||||
|
@ -27,19 +29,31 @@ fn main() {
|
|||
continue;
|
||||
}
|
||||
key_value.insert(
|
||||
line.split(":").collect::<Vec<&str>>().get(0).unwrap().trim(),
|
||||
line.split(":").collect::<Vec<&str>>().get(1).unwrap().trim(),
|
||||
line.split(":")
|
||||
.collect::<Vec<&str>>()
|
||||
.get(0)
|
||||
.unwrap()
|
||||
.trim(),
|
||||
line.split(":")
|
||||
.collect::<Vec<&str>>()
|
||||
.get(1)
|
||||
.unwrap()
|
||||
.trim(),
|
||||
);
|
||||
}
|
||||
|
||||
let html_markdown = to_html_with_options(&markdown, &Options {
|
||||
compile: CompileOptions {
|
||||
allow_dangerous_html: true,
|
||||
allow_dangerous_protocol: true,
|
||||
..CompileOptions::default()
|
||||
},
|
||||
..Options::default()}).unwrap();
|
||||
|
||||
println!("{}",html_markdown)
|
||||
let html_markdown = to_html_with_options(
|
||||
&markdown,
|
||||
&Options {
|
||||
compile: CompileOptions {
|
||||
allow_dangerous_html: true,
|
||||
allow_dangerous_protocol: true,
|
||||
..CompileOptions::default()
|
||||
},
|
||||
..Options::default()
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
println!("{}", html_markdown)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue