mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 05:03:39 +08:00
parent
fbfb164ac4
commit
e1cc4716b8
1 changed files with 15 additions and 1 deletions
|
|
@ -372,7 +372,21 @@ export function updateWordElement(showError = !Config.blindMode): void {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
let wordHighlightClassString = "incorrect";
|
||||
let correctSoFar = false;
|
||||
|
||||
// slice earlier if input has trailing compose characters
|
||||
const inputWithoutComposeLength = Misc.trailingComposeChars.test(input)
|
||||
? input.search(Misc.trailingComposeChars)
|
||||
: input.length;
|
||||
if (
|
||||
input.search(Misc.trailingComposeChars) < currentWord.length &&
|
||||
currentWord.slice(0, inputWithoutComposeLength) ===
|
||||
input.slice(0, inputWithoutComposeLength)
|
||||
) {
|
||||
correctSoFar = true;
|
||||
}
|
||||
|
||||
let wordHighlightClassString = correctSoFar ? "correct" : "incorrect";
|
||||
if (Config.blindMode) {
|
||||
wordHighlightClassString = "correct";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue