diff --git a/src/classes/Chapter.ts b/src/classes/Chapter.ts index a268f6f..8cdc786 100644 --- a/src/classes/Chapter.ts +++ b/src/classes/Chapter.ts @@ -10,6 +10,7 @@ export default class Chapter { #id: ID; #workID: ID; #name!: string; + #html!: string; #text!: string; #summary!: string; #startNote!: string; @@ -17,6 +18,7 @@ export default class Chapter { id!: Promise; workID!: Promise; name!: Promise; + html!: Promise; text!: Promise; summary!: Promise; startNote!: Promise; @@ -43,6 +45,8 @@ export default class Chapter { return target.#workID; case "name": return target.#name; + case "html": + return target.#html; case "text": return target.#text; case "summary": @@ -100,7 +104,10 @@ export default class Chapter { "div.userstuff[role='article'] > p", ), ).forEach( - (t) => this.#text += (t as Element).innerText + "\n", + (t) => { + this.#text += (t as Element).innerText + "\n"; + this.#html += (t as Element).innerHTML; + }, ); try { this.#text = this.#text.trim(); @@ -118,7 +125,10 @@ export default class Chapter { "[role='article'] > div.userstuff > p", ), ).forEach( - (t) => this.#text += (t as Element).innerText + "\n", + (t) => { + this.#text += (t as Element).innerText + "\n"; + this.#html += (t as Element).innerHTML; + }, ); } }