diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-08-03 17:07:05 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-08-03 17:07:05 +0200 |
| commit | 0bc6d195195d1e126b535554a4a4105468cd06d9 (patch) | |
| tree | 6a3288e56bd306db499e597fc53762d05a7c3b82 /src/html | |
| parent | 77642e5081b4ed2516dc08b3ef611c3c444ec6c5 (diff) | |
add tokenizer for whitespaces in js
Diffstat (limited to 'src/html')
| -rw-r--r-- | src/html/Element.zig | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/html/Element.zig b/src/html/Element.zig index 8ecf31e..a9e5897 100644 --- a/src/html/Element.zig +++ b/src/html/Element.zig @@ -39,7 +39,7 @@ fn attributesFrom(attributes: anytype) []const Attribute { const name = field.name; const value = @field(attributes, name); - const next_attr: []const Attribute = &.{ .{ .name = name, .value = value } }; + const next_attr: []const Attribute = &.{.{ .name = name, .value = value }}; attrs = attrs ++ next_attr; } @@ -79,7 +79,6 @@ pub fn toHtml(comptime self: Self) []const u8 { break :string string; }; - switch (self.content) { .void => {}, .string => |s| { @@ -91,7 +90,7 @@ pub fn toHtml(comptime self: Self) []const u8 { } string = string ++ "</" ++ self.tag ++ ">"; - } + }, } string = string ++ if (self.tag.len == 0) "" else "</" ++ self.tag ++ ">"; |