diff --git a/src/utils/markdown.rs b/src/utils/markdown.rs index aa51581..fe08de3 100644 --- a/src/utils/markdown.rs +++ b/src/utils/markdown.rs @@ -61,7 +61,13 @@ pub fn get_options(path: Option, metadata_type: MType) -> ComrakOption .superscript(true) .header_ids(match path { Some(ref fp) => { - format!("{}-", fp.path.get(..fp.path.len() - 3).unwrap_or_default()) + format!( + "{}-", + fp.path + .get(..fp.path.len() - 3) + .unwrap_or_default() + .replace(' ', "-") + ) } None => String::new(), })