Inline writeIndentation helper

This commit is contained in:
Adrià Arrufat
2026-02-18 23:02:10 +09:00
parent d264ff2801
commit 92f131bbe4

View File

@@ -152,7 +152,7 @@ fn renderElement(el: *Element, state: *State, writer: *std.Io.Writer, page: *Pag
},
.li => {
const indent = if (state.list_depth > 0) state.list_depth - 1 else 0;
try writeIndentation(indent, writer);
for (0..indent) |_| try writer.writeAll(" ");
if (state.list_depth > 0) {
const current_list = &state.list_stack[state.list_depth - 1];
@@ -399,13 +399,6 @@ fn escapeMarkdown(writer: *std.Io.Writer, text: []const u8) !void {
}
}
fn writeIndentation(level: usize, writer: *std.Io.Writer) !void {
var i: usize = 0;
while (i < level) : (i += 1) {
try writer.writeAll(" ");
}
}
fn testMarkdownHTML(html: []const u8, expected: []const u8) !void {
const testing = @import("../testing.zig");
const page = try testing.test_session.createPage();