|
|
@ -111,6 +111,11 @@ export default class Chapter {
|
|
|
|
|
|
|
|
|
|
|
|
async populateText() {
|
|
|
|
async populateText() {
|
|
|
|
this.#text = "";
|
|
|
|
this.#text = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.#html = (this.#document.querySelector(
|
|
|
|
|
|
|
|
"div.userstuff[role='article']",
|
|
|
|
|
|
|
|
) as Element).innerHTML;
|
|
|
|
|
|
|
|
|
|
|
|
Array.from(
|
|
|
|
Array.from(
|
|
|
|
this.#document.querySelectorAll(
|
|
|
|
this.#document.querySelectorAll(
|
|
|
|
"div.userstuff[role='article'] > p",
|
|
|
|
"div.userstuff[role='article'] > p",
|
|
|
@ -118,7 +123,6 @@ export default class Chapter {
|
|
|
|
).forEach(
|
|
|
|
).forEach(
|
|
|
|
(t) => {
|
|
|
|
(t) => {
|
|
|
|
this.#text += (t as Element).innerText + "\n";
|
|
|
|
this.#text += (t as Element).innerText + "\n";
|
|
|
|
this.#html += (t as Element).innerHTML;
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -132,6 +136,11 @@ export default class Chapter {
|
|
|
|
await res.text(),
|
|
|
|
await res.text(),
|
|
|
|
"text/html",
|
|
|
|
"text/html",
|
|
|
|
) as HTMLDocument;
|
|
|
|
) as HTMLDocument;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.#html = (this.#document.querySelector(
|
|
|
|
|
|
|
|
"[role='article'] > div.userstuff",
|
|
|
|
|
|
|
|
) as Element).innerHTML;
|
|
|
|
|
|
|
|
|
|
|
|
Array.from(
|
|
|
|
Array.from(
|
|
|
|
this.#document.querySelectorAll(
|
|
|
|
this.#document.querySelectorAll(
|
|
|
|
"[role='article'] > div.userstuff > p",
|
|
|
|
"[role='article'] > div.userstuff > p",
|
|
|
|