mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 21:51:29 +08:00
removing zero width characters from wikipedia mode
should help with #2835
This commit is contained in:
parent
dce8f59d2f
commit
29da29a624
1 changed files with 4 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue