From 29da29a624e8f7680cd84ed5991c5abf72027846 Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 20 Apr 2022 19:45:27 +0200 Subject: [PATCH] removing zero width characters from wikipedia mode should help with #2835 --- frontend/src/scripts/test/wikipedia.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/scripts/test/wikipedia.ts b/frontend/src/scripts/test/wikipedia.ts index e581da69d..c432a7209 100644 --- a/frontend/src/scripts/test/wikipedia.ts +++ b/frontend/src/scripts/test/wikipedia.ts @@ -96,9 +96,8 @@ export async function getSection(language: string): Promise
{ // Remove double whitespaces and finally trailing whitespaces. sectionText = sectionText.replace(/<\/p>

+/g, " "); sectionText = $("

").html(sectionText).text(); - sectionText = sectionText.replace(/\[\d+\]/gi, ""); - + sectionText = sectionText.replace(/[\u200B-\u200D\uFEFF]/g, ""); sectionText = sectionText.replace(/\s+/g, " "); sectionText = sectionText.trim(); @@ -111,6 +110,9 @@ export async function getSection(language: string): Promise
{ words.push(word); }); + console.log(sectionText); + console.log(words); + const section = new Section( sectionObj.title, sectionObj.author,