Skip to content

Commit

Permalink
fix: body and html tag are ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
CatHood0 committed Jul 15, 2024
1 parent ba5d1c9 commit 73cd556
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/html_to_delta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ export class HtmlToDelta {
convert(htmlText: string): Delta {
const delta = new Delta();
const document = parse(htmlText);
const nodesToProcess = document.childNodes;

const nodesToProcess =
document.querySelector('body')?.childNodes ||
document.querySelector('html')?.childNodes ||
document.childNodes;
for (let index: number = 0; index < nodesToProcess.length; index++) {
const node = nodesToProcess.at(index);

Expand Down

0 comments on commit 73cd556

Please sign in to comment.