Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions frontend/src/ts/elements/result-word-highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ async function init(): Promise<boolean> {

// Calculate inputWordEl properties relative to inputWordsContainerEl
inputWordEl.style.left = `${wordEl.offsetLeft + PADDING_OFFSET_X - RTL_offset}px`;
inputWordEl.innerHTML = userInputString
.replace(/\t/g, "_")
.replace(/\n/g, "_")
.replace(/</g, "&lt")
.replace(/>/g, "&gt")
.slice(0, wordEl.childElementCount);
inputWordEl.innerHTML = Misc.escapeHTML(
userInputString
.replace(/\t/g, "_")
.replace(/\n/g, "_")
.slice(0, wordEl.childElementCount),
);

inputWordEl.className = "inputWord";
inputWordsContainerEl.append(inputWordEl);
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/ts/test/test-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1402,11 +1402,7 @@ async function loadWordsHistory(): Promise<boolean> {
"beforeend",
`<div class="wordInputHighlight withSpeed">
<div class="text">
${input
.replace(/\t/g, "_")
.replace(/\n/g, "_")
.replace(/</g, "&lt")
.replace(/>/g, "&gt")}
${Misc.escapeHTML(input.replace(/\t/g, "_").replace(/\n/g, "_"))}
</div>
<div class="speed">
${isNaN(burst) || burst >= 1000 ? "Infinite" : Format.typingSpeed(burst, { showDecimalPlaces: false })}
Expand Down
Loading