Reduce chain

pull/81/head
MillenniumEarl 2021-03-11 15:19:59 +01:00
parent af226ab160
commit 23b0b2d972
1 changed files with 2 additions and 7 deletions

View File

@ -40,13 +40,8 @@ export function parseF95ThreadPost(
const elements = post const elements = post
.contents() .contents()
.toArray() .toArray()
.map((el) => { .map((el) => parseCheerioNode($, el))
const node = parseCheerioNode($, el); .filter((node) => node.name || node.text || node.content.length != 0);
if (node.name || node.text || node.content.length != 0) {
return node;
}
})
.filter((el) => el);
// ... then parse the elements to create the pairs of title/data // ... then parse the elements to create the pairs of title/data
return parsePostElements(elements); return parsePostElements(elements);