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())
|
.find(binding_markdown.as_str())
|
||||||
.expect("Can't find key value map in markdown");
|
.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();
|
let mut key_value: HashMap<&str, &str> = HashMap::new();
|
||||||
|
|
||||||
|
@ -27,19 +29,31 @@ fn main() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
key_value.insert(
|
key_value.insert(
|
||||||
line.split(":").collect::<Vec<&str>>().get(0).unwrap().trim(),
|
line.split(":")
|
||||||
line.split(":").collect::<Vec<&str>>().get(1).unwrap().trim(),
|
.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 {
|
let html_markdown = to_html_with_options(
|
||||||
compile: CompileOptions {
|
&markdown,
|
||||||
allow_dangerous_html: true,
|
&Options {
|
||||||
allow_dangerous_protocol: true,
|
compile: CompileOptions {
|
||||||
..CompileOptions::default()
|
allow_dangerous_html: true,
|
||||||
},
|
allow_dangerous_protocol: true,
|
||||||
..Options::default()}).unwrap();
|
..CompileOptions::default()
|
||||||
|
},
|
||||||
println!("{}",html_markdown)
|
..Options::default()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
println!("{}", html_markdown)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue