removing zero width characters from wikipedia mode

should help with #2835
This commit is contained in:
Miodec 2022-04-20 19:45:27 +02:00
parent dce8f59d2f
commit 29da29a624

View file

@ -96,9 +96,8 @@ export async function getSection(language: string): Promise<Section> {
// Remove double whitespaces and finally trailing whitespaces.
sectionText = sectionText.replace(/<\/p><p>+/g, " ");
sectionText = $("<div/>").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<Section> {
words.push(word);
});
console.log(sectionText);
console.log(words);
const section = new Section(
sectionObj.title,
sectionObj.author,