diff --git a/src/lib.zig b/src/lib.zig index bc56cd9a6864bbd1a5b6b955c634658e2d51641c..f5b446ebb11c89b2e38b25c961418a5a6bf1cfa9 100644 --- a/src/lib.zig +++ b/src/lib.zig @@ -135,6 +135,12 @@ fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, d if (!opts.escaped) try writer.writeAll(s); return; } + if (TI == .Enum) { + const s = @tagName(x); + if (opts.escaped) try writeEscaped(s, writer); + if (!opts.escaped) try writer.writeAll(s); + return; + } @compileError(std.fmt.comptimePrint("pek: print {s}: unsupported type: {s}", .{ v, @typeName(TO) })); }, .block => |v| { @@ -400,6 +406,8 @@ fn isCodepointAnEntity(cp: u21) ?htmlentities.Entity { ')', '%', '+', + '/', + '@', => return null, else => {}, }