From 1afbec2d84067ef87ae05e1c82e737a1086c64e8 Mon Sep 17 00:00:00 2001 From: Peter Noble Date: Fri, 21 Feb 2020 11:01:41 +0000 Subject: [PATCH] Additional Replacements for Filenames (#2625) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Strip colons from filenames * Add global matching for accented characters * Add more replacements * Added more diacritics Namely: č,ć, ň, ń, ś, ž, ź Co-authored-by: Lucas Becker --- scripts/utils.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/utils.js b/scripts/utils.js index 6b2d0a15..6cb0fc9f 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -12,15 +12,17 @@ module.exports = { .replace(/^&/, "and-") .replace(/&$/, "-and") .replace(/&/g, "-and-") - .replace(/[ !’]/g, "") - .replace(/à|á|â|ã|ä/, "a") - .replace(/ç/, "c") - .replace(/è|é|ê|ë/, "e") - .replace(/ì|í|î|ï/, "i") - .replace(/ñ/, "n") - .replace(/ò|ó|ô|õ|ö/, "o") - .replace(/ù|ú|û|ü/, "u") - .replace(/ý|ÿ/, "y") + .replace(/[ !:’']/g, "") + .replace(/à|á|â|ã|ä/g, "a") + .replace(/ç|č|ć/g, "c") + .replace(/è|é|ê|ë/g, "e") + .replace(/ì|í|î|ï/g, "i") + .replace(/ñ|ň|ń/g, "n") + .replace(/ò|ó|ô|õ|ö/g, "o") + .replace(/š|ś/g, "s") + .replace(/ù|ú|û|ü/g, "u") + .replace(/ý|ÿ/g, "y") + .replace(/ž|ź/g, "z") ), /**