replace spaces by dashes

This commit is contained in:
Mylloon 2024-12-13 19:12:00 +01:00
parent b20e82bc4c
commit 1fd7175e56
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -61,7 +61,13 @@ pub fn get_options(path: Option<FilePath>, metadata_type: MType) -> ComrakOption
.superscript(true) .superscript(true)
.header_ids(match path { .header_ids(match path {
Some(ref fp) => { 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(), None => String::new(),
}) })