Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
See: #1169
  • Loading branch information
dteviot committed Jan 19, 2024
1 parent acee3bf commit e50622e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions plugin/js/parsers/MadnovelParser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"use strict";

parserFactory.register("madnovel.com", () => new MadnovelParser());

parserFactory.register("novelbuddy.com", () => new MadnovelParser());
parserFactory.register("novelbuddy.io", () => new MadnovelParser());

class MadnovelParser extends Parser {
constructor() {
Expand Down Expand Up @@ -34,17 +35,24 @@ class MadnovelParser extends Parser {
}

extractSubject(dom) {
let tags = [...dom.querySelectorAll("a[href*='genres'] span")]
return tags.map(e => e.textContent.trim()).join(", ");
let tags = [...dom.querySelectorAll("a[href*='genres']")]
return tags.map(e => e.textContent.trim()).join("");
}

removeUnwantedElementsFromContentElement(element) {
util.removeChildElementsMatchingCss(element, ".ads-banner, .content-inner > br");
super.removeUnwantedElementsFromContentElement(element);
}

findChapterTitle(dom) {
return dom.querySelector("#chapter__content h1");
}

findCoverImageUrl(dom) {
return util.getFirstImgSrc(dom, ".img-cover");
}

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll(".section-body.summary")];
}
}

0 comments on commit e50622e

Please sign in to comment.