Don't parse spoiler text

pull/83/head
MillenniumEarl 2021-03-21 11:40:57 +01:00
parent 8cdc7c718a
commit 5f9ad0056a
1 changed files with 3 additions and 3 deletions

View File

@ -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]);
} }