mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 05:03:39 +08:00
fix(result word history): incorrect words not being underlined
This commit is contained in:
parent
c75c6d8ea1
commit
61862571f4
1 changed files with 7 additions and 3 deletions
|
|
@ -1148,19 +1148,23 @@ async function loadWordsHistory(): Promise<boolean> {
|
|||
) !== null;
|
||||
let wordEl = "";
|
||||
try {
|
||||
if (input === undefined || input === "")
|
||||
if (input === undefined || input === "") {
|
||||
throw new Error("empty input word");
|
||||
}
|
||||
|
||||
const errorClass = input !== word ? "error" : "";
|
||||
|
||||
if (corrected !== undefined && corrected !== "") {
|
||||
const correctedChar = !containsKorean
|
||||
? corrected
|
||||
: Hangul.assemble(corrected.split(""));
|
||||
wordEl = `<div class='word nocursor' burst="${
|
||||
wordEl = `<div class='word nocursor ${errorClass}' burst="${
|
||||
TestInput.burstHistory[i]
|
||||
}" input="${correctedChar
|
||||
.replace(/"/g, """)
|
||||
.replace(/ /g, "_")}">`;
|
||||
} else {
|
||||
wordEl = `<div class='word nocursor' burst="${
|
||||
wordEl = `<div class='word nocursor ${errorClass}' burst="${
|
||||
TestInput.burstHistory[i]
|
||||
}" input="${input.replace(/"/g, """).replace(/ /g, "_")}">`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue