fix: Ignore html comment elements

This commit is contained in:
Gabe
2025-05-17 23:19:38 +08:00
parent 6855332092
commit 24f8959525

View File

@@ -516,7 +516,7 @@ export class Translator {
}
text += `[${keeps.length}]`;
keeps.push(child.outerHTML);
} else {
} else if (child.nodeType === 1 || child.nodeType === 3) {
text += child.textContent;
}
});