From 6f19d0de7bcbd9340c92fe0057e54ecc2ab750fe Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 19 Apr 2024 14:33:50 +0200 Subject: [PATCH] Replace lookalike chars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In french ’ is more correct than ' but only easily achiveable on specific keyboard layout. The exercices of ngram-types fr are using ' Replace non-breaking space by space --- app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app.js b/app.js index 4373348..6c9393b 100644 --- a/app.js +++ b/app.js @@ -318,6 +318,14 @@ var ngramTypeConfig = { this.resumeTimer(); + var substitutions = [ + ["’", "'"], + [" ", " "], + ]; + for (var subst of substitutions) { + typedPhrase = typedPhrase.replaceAll(subst[0], subst[1]); + } + if (this.expectedPhrase.startsWith(typedPhrase)) { if (this.data.soundCorrectLetterEnabled) { this.stopCurrentPlayingSound();