Tried to fix Wikipedia newline issue (#2193) by Estebene

This commit is contained in:
Estebene 2021-12-20 04:40:32 +13:00 committed by GitHub
parent 7339213747
commit f1bcc7b7f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,6 +46,11 @@ export async function getSection() {
sectionText = sectionText.replace(/\s+/g, " ");
sectionText = sectionText.trim();
// Add spaces
sectionText = sectionText.replace(/[a-zA-Z0-9]{3,}\.[a-zA-Z]/g, (x) =>
x.replace(/\./, ". ")
);
sectionText.split(" ").forEach((word) => {
words.push(word);
});