Formatting
All checks were successful
run check / cargo check (push) Successful in 3m55s

This commit is contained in:
viridian 2024-03-31 20:14:09 +02:00
parent a3416544f1
commit 21961c505a
Signed by: viridian
GPG key ID: DCD4DF95CE23FE8C

View file

@ -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)
}