diff --git a/frontend/src/ts/test/wikipedia.ts b/frontend/src/ts/test/wikipedia.ts index 289f4320c..64fbbd614 100644 --- a/frontend/src/ts/test/wikipedia.ts +++ b/frontend/src/ts/test/wikipedia.ts @@ -51,7 +51,7 @@ export async function getSection(language: string): Promise
{ // get TLD for wikipedia according to language group let urlTLD = "en"; - let currentLanguageGroup; + let currentLanguageGroup: MonkeyTypes.LanguageGroup | undefined; try { currentLanguageGroup = await Misc.findCurrentGroup(language); } catch (e) { @@ -109,6 +109,10 @@ export async function getSection(language: string): Promise
{ // Removing whitespace before and after text sectionText = sectionText.trim(); + if (urlTLD === "en") { + sectionText = sectionText.replace(/[^\x20-\x7E]+/g, ""); + } + const words = sectionText.split(" "); const section = new Section(