diff --git a/src/template/lib.zig b/src/template/lib.zig index 4e8803c..4698cab 100644 --- a/src/template/lib.zig +++ b/src/template/lib.zig @@ -210,6 +210,7 @@ fn print(writer: anytype, arg: anytype) !void { if (T == void) return; if (comptime std.meta.trait.isZigString(T)) return htmlEscape(writer, arg); if (comptime std.meta.trait.isNumber(T)) return std.fmt.format(writer, "{}", .{arg}); + if (comptime std.meta.trait.is(.Optional)(T)) return if (arg) |a| try print(writer, a); try std.fmt.format(writer, "{}", .{arg}); }