authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-03-28 02:04:19 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-03-28 02:04:19 -07:00
log303ff1d58b47da1e64f24cf927178456140153bf
tree62f883e1f9317d07394b39561fa3136b666ea390
parent9d95a343c2f9c61b67c7e6f36f0e3907052f140f

dont convert / and @ to html entities


1 files changed, 8 insertions(+), 0 deletions(-)

src/lib.zig+8
......@@ -135,6 +135,12 @@ fn do(alloc: std.mem.Allocator, writer: anytype, comptime value: astgen.Value, d
135135 if (!opts.escaped) try writer.writeAll(s);
136136 return;
137137 }
138 if (TI == .Enum) {
139 const s = @tagName(x);
140 if (opts.escaped) try writeEscaped(s, writer);
141 if (!opts.escaped) try writer.writeAll(s);
142 return;
143 }
138144 @compileError(std.fmt.comptimePrint("pek: print {s}: unsupported type: {s}", .{ v, @typeName(TO) }));
139145 },
140146 .block => |v| {
......@@ -400,6 +406,8 @@ fn isCodepointAnEntity(cp: u21) ?htmlentities.Entity {
400406 ')',
401407 '%',
402408 '+',
409 '/',
410 '@',
403411 => return null,
404412 else => {},
405413 }