Skip to content

Commit

Permalink
fix(src content-script): remove HTML tags from all answers
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnord committed Mar 17, 2023
1 parent 381cb43 commit 4bf5687
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/content-script.ts
Expand Up @@ -167,7 +167,7 @@ class FinalRoundParser {
{
clue: this.clue,
value: 0,
answer: this.answer!,
answer: this.answer,
},
],
},
Expand Down Expand Up @@ -234,7 +234,7 @@ class RoundParser {
const clueDict: Clue = {
value: clue.value,
clue: clue.clue,
answer: clue.answer!,
answer: clue.answer,
};
jsonData.categories[categoryIdx].clues.push(clueDict);
}
Expand Down Expand Up @@ -286,8 +286,9 @@ class ClueParser {
const mouseOverDiv =
clueDiv.children[0]?.children[0]?.children[0]?.children[0]?.children[0];
try {
const answer = parseCorrectResponse(mouseOverDiv, `clue ${i}, ${j}`);
this.answer = answer;
const answerHtml = parseCorrectResponse(mouseOverDiv, `clue ${i}, ${j}`);
// Remove HTML tags from the answer
this.answer = answerHtml.replace(/<[^>]*>/g, "");
} catch (error: unknown) {
if (isNotFoundError(error)) {
this.answer = "Unrevealed";
Expand Down

0 comments on commit 4bf5687

Please sign in to comment.