File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,14 @@ pub const Node = struct {
7575 .text = > .{ .Text = @as (* parser .Text , @ptrCast (node )) },
7676 .cdata_section = > .{ .CDATASection = @as (* parser .CDATASection , @ptrCast (node )) },
7777 .processing_instruction = > .{ .ProcessingInstruction = @as (* parser .ProcessingInstruction , @ptrCast (node )) },
78- .document = > .{ .HTMLDocument = @as (* parser .DocumentHTML , @ptrCast (node )) },
78+ .document = > blk : {
79+ const doc : * parser.Document = @ptrCast (node );
80+ if (doc .is_html ) {
81+ break :blk .{ .HTMLDocument = @as (* parser .DocumentHTML , @ptrCast (node )) };
82+ }
83+
84+ break :blk .{ .Document = doc };
85+ },
7986 .document_type = > .{ .DocumentType = @as (* parser .DocumentType , @ptrCast (node )) },
8087 .attribute = > .{ .Attr = @as (* parser .Attribute , @ptrCast (node )) },
8188 .document_fragment = > .{ .DocumentFragment = @as (* parser .DocumentFragment , @ptrCast (node )) },
You can’t perform that action at this time.
0 commit comments