From e3f43322853384d08e1d15937c9bac6d46406551 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 4 Jul 2021 16:12:10 +0100 Subject: [PATCH] added regex to check for limiting characters. should fix #1592 --- src/js/input-controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/input-controller.js b/src/js/input-controller.js index acb5dd85a..9944ee83f 100644 --- a/src/js/input-controller.js +++ b/src/js/input-controller.js @@ -165,7 +165,7 @@ function handleBackspace(event) { // TestLogic.input.appendCurrent(limiter); // } - if (/^\W*$/g.test(TestLogic.input.getCurrent())) { + if (/^[ £§`~!@#$%^&*()_+-=[]{};':"\|,.\/<>\?]*$/g.test(TestLogic.input.getCurrent())) { //pop current and previous TestLogic.input.resetCurrent(); TestLogic.input.popHistory(); @@ -181,7 +181,7 @@ function handleBackspace(event) { TestLogic.input.popHistory(); TestLogic.corrected.popHistory(); } else { - const regex = new RegExp("\\W", "g"); + const regex = new RegExp(/[ £§`~!@#$%^&*()_+-=[]{};':"\|,.\/<>\?]/, "g"); let input = TestLogic.input.getCurrent();