Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

formatHtml

renderer.formatHtml
fn formatHtml(bytes: []const u8, w: *Writer) Writer.Error!void

File

lib/docs/wasm/markdown/renderer.zig:238

Code

fn formatHtml(bytes: []const u8, w: *Writer) Writer.Error!void {
    for (bytes) |b| switch (b) {
        '<' => try w.writeAll("&lt;"),
        '>' => try w.writeAll("&gt;"),
        '&' => try w.writeAll("&amp;"),
        '"' => try w.writeAll("&quot;"),
        else => try w.writeByte(b),
    };
}