From c5f5affda8c323d27f9120f6b860202e1dc068b7 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 29 Sep 2024 11:33:23 +0200 Subject: fix(MangledName): Also replace `"` and `'` --- src/new/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/new/mod.rs b/src/new/mod.rs index 0c4114c..fed4ff3 100644 --- a/src/new/mod.rs +++ b/src/new/mod.rs @@ -12,13 +12,18 @@ pub struct MangledName(String); impl MangledName { pub fn new(name: &str) -> Self { - let safe_name = name + let new_name = deunicode(&name.to_case(Case::Snake)); + + let safe_name = new_name // TeX fails to include/input stuff with a colon in it. .replace(':', "_") // This obviously creates weird extra directories - .replace('/', "_"); + .replace('/', "_") + // These are just difficult to use on the command line + .replace('"', "_") + .replace('\'', "_"); - let ascii_name = deunicode(&safe_name.to_case(Case::Snake)).to_case(Case::Snake); + let ascii_name = safe_name.to_case(Case::Snake); Self(ascii_name) } -- cgit 1.4.1