* useless compileoption
* use any instead of fold
This commit is contained in:
parent
d4ff53cee8
commit
ff7fa90cdc
1 changed files with 3 additions and 11 deletions
|
@ -60,8 +60,6 @@ pub fn read_md(filename: &str) -> (Metadata, String) {
|
|||
|
||||
let compile_option = markdown::CompileOptions {
|
||||
allow_dangerous_html: true,
|
||||
gfm_footnote_label: Some("Notes de bas de page".into()),
|
||||
gfm_footnote_back_label: Some("Arrière".into()),
|
||||
..markdown::CompileOptions::gfm()
|
||||
};
|
||||
|
||||
|
@ -85,15 +83,9 @@ pub fn read_md(filename: &str) -> (Metadata, String) {
|
|||
.unwrap();
|
||||
|
||||
// Find if document contains mermaid diagram
|
||||
let presence_mermaid = md_nodes.iter().fold(false, |acc, x| {
|
||||
if !acc {
|
||||
match x {
|
||||
let presence_mermaid = md_nodes.iter().any(|x| match x {
|
||||
markdown::mdast::Node::Code(code) => code.lang == Some(String::from("mermaid")),
|
||||
_ => false,
|
||||
}
|
||||
} else {
|
||||
false
|
||||
}
|
||||
});
|
||||
|
||||
(
|
||||
|
|
Loading…
Reference in a new issue