From 9e66cc6e7aab8d524910a76ce7ea902320dd6af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 27 Mar 2024 11:49:35 +0100 Subject: [PATCH] Refactor again icon conversion to use properties for 'fill' and 'stroke' direct in 'svg' tags in icon components --- frontend/src/assets/icons/helpers/convertSvgToVue.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/assets/icons/helpers/convertSvgToVue.js b/frontend/src/assets/icons/helpers/convertSvgToVue.js index c4ee28ec7..9f689cc47 100644 --- a/frontend/src/assets/icons/helpers/convertSvgToVue.js +++ b/frontend/src/assets/icons/helpers/convertSvgToVue.js @@ -16,7 +16,14 @@ readdirSync(inputDir).forEach((file) => { const fileName = parse(file).name // eslint-disable-next-line security/detect-non-literal-fs-filename const content = readFileSync(filePath, 'utf8') - const vueComponent = `\n\n\n` + + // add 'fill' and 'stroke' attributes to SVG code + const modifiedContent = content.replace( + /]*)>/, + '', + ) + + const vueComponent = `\n\n\n` const outputFilePath = join(outputDir, `${fileName}.vue`) // eslint-disable-next-line security/detect-non-literal-fs-filename