File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -907,11 +907,19 @@ pub fn SuperTemplate(comptime ScriptyVM: type) type {
907907 }
908908
909909 if (elem .kind .isElement () and ! elem .kind .isVoid ()) {
910- // Print up to the close tag
911- const end = elem .close .end ;
912- const up_to_attr = tpl .src [tpl .print_cursor .. end ];
913- writer .writeAll (up_to_attr ) catch return error .OutIO ;
914- tpl .print_cursor = end ;
910+ if (elem .self_closing ) {
911+ // Synthesize a closing tag
912+ writer .print ("</{s}>" , .{
913+ elem .open .getName (tpl .src , tpl .html .language ).slice (tpl .src ),
914+ }) catch return error .OutIO ;
915+
916+ } else {
917+ // Print up to the close tag
918+ const end = elem .close .end ;
919+ const up_to_end = tpl .src [tpl .print_cursor .. end ];
920+ writer .writeAll (up_to_end ) catch return error .OutIO ;
921+ tpl .print_cursor = end ;
922+ }
915923 }
916924 _ = tpl .cursor .next ();
917925 },
You can’t perform that action at this time.
0 commit comments