add pre tags for html

This commit is contained in:
Emil Lerch 2026-01-06 10:45:37 -08:00
parent 06b4a6057a
commit ce958837e0
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -110,6 +110,7 @@ pub fn render(allocator: std.mem.Allocator, data: types.WeatherData, options: Re
defer output.deinit();
const w = &output.writer;
if (options.format == .html) try w.writeAll("<pre>");
if (!options.no_caption)
try w.print("Weather report: {s}\n\n", .{data.locationDisplayName()});
@ -122,6 +123,7 @@ pub fn render(allocator: std.mem.Allocator, data: types.WeatherData, options: Re
try renderForecastDay(w, day, options);
}
}
if (options.format == .html) try w.writeAll("</pre>");
return output.toOwnedSlice();
}