support rich text comments

This commit is contained in:
2024-11-18 17:09:36 +08:00
parent ea042b848a
commit 9c021a8248
3 changed files with 15 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ class Ehentai extends ComicSource {
// unique id of the source
key = "ehentai"
version = "1.0.7"
version = "1.0.8"
minAppVersion = "1.0.0"
@@ -963,7 +963,13 @@ class Ehentai extends ComicSource {
for(let c of document.querySelectorAll('div.c1')) {
let name = c.querySelector('div.c3 > a').text
let time = c.querySelector('div.c3')?.text?.split("Posted on")?.at(1)?.split('by')?.at(0)?.trim() ?? 'unknown'
let content = c.querySelector('div.c6').text
let content = ''
if(typeof appVersion) {
// since 1.0.6, [appVersion] field is available and rich comment is supported
content = c.querySelector('div.c6').innerHTML
} else {
content = c.querySelector('div.c6').text
}
let score = Number(c.querySelector('div.c5 > span')?.text)
if(isNaN(score)) {
score = null