Skip to content

Commit

Permalink
fix comment display
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 committed Sep 6, 2024
1 parent 85c9047 commit 379b2ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/adapter/templates/getNodeChildren.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ export const getNodeChildren = remoteFunction(function(
const to = count === -1 ? this.childNodes.length : start + count;
for (let i = from; i < to && i < this.childNodes.length; ++i) {
const cn = this.childNodes[i];
result[i] = cn.nodeName === '#text' ? (cn.textContent || '') : this.childNodes[i];
if (cn.nodeName === '#comment') {
result[i] = `<!-- ${cn.textContent} -->`;
} else if (cn.nodeName === '#text') {
result[i] = cn.textContent || '';
} else {
result[i] = cn;
}
}

return result;
Expand Down

0 comments on commit 379b2ff

Please sign in to comment.