From ea44eeb52b14e8afd951382a8e2b78d2e9d75849 Mon Sep 17 00:00:00 2001 From: octod Date: Wed, 1 Nov 2017 14:33:47 +0100 Subject: [PATCH] chore: Fixes accents replacement regexp. --- .gulp/tasks/icons-accents.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gulp/tasks/icons-accents.ts b/.gulp/tasks/icons-accents.ts index 04eef61..dee9cf8 100644 --- a/.gulp/tasks/icons-accents.ts +++ b/.gulp/tasks/icons-accents.ts @@ -42,13 +42,17 @@ function replaceNameWithAccent(name: string, accentName: string): string { * @returns {string} */ export function replaceSVGColour(filecontent: string, colour: string): string { - return filecontent.replace(new RegExp('.st0\{fill:\s{0,}#([a-zA-Z0-9]{6})\}|path fill="#([a-zA-Z0-9]{6})"'), ($0, $1, $2) => { + return filecontent.replace(new RegExp('.st0\{fill:\s{0,}#([a-zA-Z0-9]{6})|path fill="#([a-zA-Z0-9]{6})"'), ($0, $1, $2) => { colour = colour.replace('#', ''); if (!$2) { + console.log(`Replacing colour ${ $1 } with ${ colour }`) + return $0.replace($1, colour); } else { + console.log(`Replacing colour ${ $2 } with ${ colour }`) + return $0.replace($2, colour); } });