Skip to content

Commit 48c3d22

Browse files
committed
fix tag recognition in superhtml mode
1 parent f0438a5 commit 48c3d22

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/html/Ast.zig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -718,17 +718,17 @@ pub fn init(
718718
current = &nodes.items[current.parent_idx];
719719
}
720720

721+
const name = tag.name.slice(src);
721722
const end_kind = switch (language) {
722-
// .superhtml => {
723-
// if (elements.get(name)) |element| {
724-
// break :node .{
725-
// .kind = element.tag,
726-
// .content = .all,
727-
// .open = tag.span,
728-
// };
729-
// } else continue :lang .html;
730-
// },
731-
.html, .superhtml => kinds.get(tag.name.slice(src)) orelse .___,
723+
.superhtml => if (std.ascii.eqlIgnoreCase("ctx", name))
724+
.ctx
725+
else if (std.ascii.eqlIgnoreCase("super", name))
726+
.super
727+
else if (std.ascii.eqlIgnoreCase("extend", name))
728+
.extend
729+
else
730+
kinds.get(name) orelse .___,
731+
.html => kinds.get(name) orelse .___,
732732
.xml => .___,
733733
};
734734

src/html/elements/source.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub const source: Element = .{
1212
.meta = .{
1313
.categories_superset = .none,
1414
},
15-
.attributes = .manual,
15+
.attributes = .manual, // done by <audio>, <video> and <picture>
1616
.content = .model,
1717
.desc =
1818
\\The `<source>` HTML element specifies one or more media resources for

0 commit comments

Comments
 (0)