From bf537b6dc22b4c4f2d7b867e991f20fc83643022 Mon Sep 17 00:00:00 2001 From: Tim Hajdinjak <69644152+timhaj@users.noreply.github.com> Date: Wed, 1 May 2024 18:31:20 +0200 Subject: [PATCH] Fixed double quotation mark bug in font guessing game --- font.ts | 2 +- js/font.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/font.ts b/font.ts index b342588..1a555d9 100644 --- a/font.ts +++ b/font.ts @@ -61,7 +61,7 @@ document.body.appendChild(container); function handle(selected: any): void { let selectedFont: string = selected.style.fontFamily; - if (selectedFont == guessingFonts[fontToGuess]) { + if (selectedFont == guessingFonts[fontToGuess] || selectedFont.substring(1, selectedFont.length - 1) == guessingFonts[fontToGuess]) { if (!gameWin) { for (let i: number = 0; i < fontDiv.children.length; i++) { let child: any = fontDiv.children[i]; diff --git a/js/font.js b/js/font.js index ab88b11..02feb3c 100644 --- a/js/font.js +++ b/js/font.js @@ -57,7 +57,7 @@ container.appendChild(element); document.body.appendChild(container); function handle(selected) { let selectedFont = selected.style.fontFamily; - if (selectedFont == guessingFonts[fontToGuess]) { + if (selectedFont == guessingFonts[fontToGuess] || selectedFont.substring(1, selectedFont.length - 1) == guessingFonts[fontToGuess]) { if (!gameWin) { for (let i = 0; i < fontDiv.children.length; i++) { let child = fontDiv.children[i];