From 1fd7175e56872c35a70ac5a093cbde59e1e8d2d7 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 13 Dec 2024 19:12:00 +0100 Subject: [PATCH] replace spaces by dashes --- src/utils/markdown.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(), })