Replace "el" with "e"
parent
061008c5a5
commit
fdc944ecbf
|
@ -118,8 +118,8 @@ function isLinkNode(node: cheerio.Element): boolean {
|
||||||
|
|
||||||
// The node is a valid DOM element
|
// The node is a valid DOM element
|
||||||
if (node.type === "tag") {
|
if (node.type === "tag") {
|
||||||
const el = node as cheerio.TagElement;
|
const e = node as cheerio.TagElement;
|
||||||
valid = el.name === "a" || el.name === "img";
|
valid = e.name === "a" || e.name === "img";
|
||||||
}
|
}
|
||||||
|
|
||||||
return valid;
|
return valid;
|
||||||
|
@ -189,7 +189,7 @@ function parseCheerioSpoilerNode($: cheerio.Root, node: cheerio.Cheerio): IPostE
|
||||||
.find(POST.SPOILER_CONTENT)
|
.find(POST.SPOILER_CONTENT)
|
||||||
.contents()
|
.contents()
|
||||||
.toArray()
|
.toArray()
|
||||||
.map((el) => parseCheerioNode($, el));
|
.map((e) => parseCheerioNode($, e));
|
||||||
|
|
||||||
// Clean text (Spoiler has no text) @todo
|
// 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();
|
||||||
|
@ -320,7 +320,7 @@ function getCheerioNonChildrenText(node: cheerio.Cheerio): string {
|
||||||
text = node
|
text = node
|
||||||
.first()
|
.first()
|
||||||
.contents() // @todo Change to children() after cheerio RC6
|
.contents() // @todo Change to children() after cheerio RC6
|
||||||
.filter((idx, el) => isTextNode(el))
|
.filter((idx, e) => isTextNode(e))
|
||||||
.text();
|
.text();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue