mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-13 15:36:42 +08:00
added regex to check for limiting characters. should fix #1592
This commit is contained in:
parent
afa895991d
commit
e3f4332285
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue