Don't parse spoiler text
parent
8cdc7c718a
commit
5f9ad0056a
|
@ -162,8 +162,8 @@ function parseCheerioSpoilerNode($: cheerio.Root, node: cheerio.Cheerio): IPostE
|
||||||
.toArray()
|
.toArray()
|
||||||
.map((el) => parseCheerioNode($, el));
|
.map((el) => parseCheerioNode($, el));
|
||||||
|
|
||||||
// Clean text
|
// Clean text (Spoiler has no text) @todo
|
||||||
spoiler.text = spoiler.text.replace(/\s\s+/g, " ").trim();
|
// spoiler.text = spoiler.text.replace(/\s\s+/g, " ").trim();
|
||||||
return spoiler;
|
return spoiler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ function reducePostElement(element: IPostElement): IPostElement {
|
||||||
// Local variables
|
// Local variables
|
||||||
const shallowCopy = Object.assign({}, element);
|
const shallowCopy = Object.assign({}, element);
|
||||||
|
|
||||||
// If the node has only one child, return it
|
// If the node has only one child, reduce and return it
|
||||||
if (isPostElementUnknown(shallowCopy) && shallowCopy.content.length === 1) {
|
if (isPostElementUnknown(shallowCopy) && shallowCopy.content.length === 1) {
|
||||||
return reducePostElement(shallowCopy.content[0]);
|
return reducePostElement(shallowCopy.content[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue