From f538c62f4a2f20596f7645af3a083766302110da Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Wed, 12 Feb 2025 20:11:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Put=20the=20adaptedText=20in=20a?= =?UTF-8?q?=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index c23bfd7..0bbd543 100644 --- a/main.js +++ b/main.js @@ -9,7 +9,12 @@ const position = {x: 4, y: 2, gravity: "NorthEast"} const metadatas = [] function createFilename(prideflag, text, now = false) { - return `${prideflag.name.en.toLowerCase()}-${text.replaceAll("⋅", "_").replaceAll(" ", "_").replaceAll("\n", '-').toLowerCase()}${now?'-now':''}.png`; + const adaptedText = text + .replaceAll("⋅", "_") + .replaceAll(" ", "_") + .replaceAll("\n", '-') + .toLowerCase(); + return `${prideflag.name.en.toLowerCase()}-${adaptedText}${now?'-now':''}.png`; } function createButton(source, x, y, text, gravity) {