css: check if node is an html element

This commit is contained in:
Pierre Tachoire
2024-03-18 11:36:06 +01:00
parent 7839f466ea
commit 4629e8a9eb
3 changed files with 10 additions and 1 deletions

View File

@@ -167,7 +167,7 @@ pub const Selector = union(enum) {
pub fn match(s: Selector, n: anytype) !bool {
return switch (s) {
.tag => |v| std.ascii.eqlIgnoreCase(v, try n.tag()),
.tag => |v| n.isElement() and std.ascii.eqlIgnoreCase(v, try n.tag()),
else => false,
};
}