We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09fbbc1 commit d2a68e6Copy full SHA for d2a68e6
src/cdp/Node.zig
@@ -260,6 +260,19 @@ pub const Writer = struct {
260
try w.write(parent_node.id);
261
}
262
263
+ const _map = try parser.nodeGetAttributes(n);
264
+ if (_map) |map| {
265
+ const attr_count = try parser.namedNodeMapGetLength(map);
266
+ try w.objectField("attributes");
267
+ try w.beginArray();
268
+ for (0..attr_count) |i| {
269
+ const attr = try parser.namedNodeMapItem(map, @intCast(i)) orelse continue;
270
+ try w.write(try parser.attributeGetName(attr));
271
+ try w.write(try parser.attributeGetValue(attr) orelse continue);
272
+ }
273
+ try w.endArray();
274
275
+
276
try w.objectField("nodeType");
277
try w.write(@intFromEnum(try parser.nodeType(n)));
278
0 commit comments