mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Inline writeIndentation helper
This commit is contained in:
@@ -152,7 +152,7 @@ fn renderElement(el: *Element, state: *State, writer: *std.Io.Writer, page: *Pag
|
|||||||
},
|
},
|
||||||
.li => {
|
.li => {
|
||||||
const indent = if (state.list_depth > 0) state.list_depth - 1 else 0;
|
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) {
|
if (state.list_depth > 0) {
|
||||||
const current_list = &state.list_stack[state.list_depth - 1];
|
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 {
|
fn testMarkdownHTML(html: []const u8, expected: []const u8) !void {
|
||||||
const testing = @import("../testing.zig");
|
const testing = @import("../testing.zig");
|
||||||
const page = try testing.test_session.createPage();
|
const page = try testing.test_session.createPage();
|
||||||
|
|||||||
Reference in New Issue
Block a user