css: implement id and class match selector

This commit is contained in:
Pierre Tachoire
2024-03-18 12:48:03 +01:00
parent 4629e8a9eb
commit d64fffc5b3
4 changed files with 61 additions and 12 deletions

View File

@@ -28,4 +28,8 @@ pub const Node = struct {
pub fn tag(n: Node) ![]const u8 {
return try parser.nodeName(n.node);
}
pub fn attr(n: Node, key: []const u8) !?[]const u8 {
return try parser.elementGetAttribute(parser.nodeToElement(n.node), key);
}
};