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()) .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)
} }