From 5854db5fff7851c49e371421e19d51b097895492 Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Thu, 22 Dec 2022 03:28:14 -0500 Subject: [PATCH] actually give correct html --- src/classes/Chapter.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/classes/Chapter.ts b/src/classes/Chapter.ts index f5d080a..450217c 100644 --- a/src/classes/Chapter.ts +++ b/src/classes/Chapter.ts @@ -111,6 +111,11 @@ export default class Chapter { async populateText() { this.#text = ""; + + this.#html = (this.#document.querySelector( + "div.userstuff[role='article']", + ) as Element).innerHTML; + Array.from( this.#document.querySelectorAll( "div.userstuff[role='article'] > p", @@ -118,7 +123,6 @@ export default class Chapter { ).forEach( (t) => { this.#text += (t as Element).innerText + "\n"; - this.#html += (t as Element).innerHTML; }, ); try { @@ -132,6 +136,11 @@ export default class Chapter { await res.text(), "text/html", ) as HTMLDocument; + + this.#html = (this.#document.querySelector( + "[role='article'] > div.userstuff", + ) as Element).innerHTML; + Array.from( this.#document.querySelectorAll( "[role='article'] > div.userstuff > p",