use a better comparison to detect comment

This commit is contained in:
Pierre Tachoire
2025-12-07 09:52:59 +01:00
parent a673eb89b6
commit 240e8b3502

View File

@@ -175,12 +175,8 @@ pub fn getTextContent(self: *Node, writer: *std.Io.Writer) error{WriteFailed}!vo
var it = self.childrenIterator();
while (it.next()) |child| {
// ignore comments and TODO processing instructions.
switch (child._type) {
.cdata => |c| switch (c._type) {
.comment => continue,
.text => {},
},
else => {},
if (child.is(CData.Comment) != null) {
continue;
}
try child.getTextContent(writer);
}