╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ web.zig ──────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
300 if (x >= r.x and y >= r.y and x < r.x + r.size.width and y < r.y + r.size.height) { 301 return entry.key_ptr.*; 302 } 303 } 304 return null; 305 } 306 307 fn appendEscapedHtml(allocator: std.mem.Allocator, out: *std.ArrayList(u8), input: []const u8) !void { 308 for (input) |ch| { 309 switch (ch) { 310 '&' => try out.appendSlice(allocator, "&amp;"), 311 '<' => try out.appendSlice(allocator, "&lt;"), 312 '>' => try out.appendSlice(allocator, "&gt;"), 313 '"' => try out.appendSlice(allocator, "&quot;"), 314 '\'' => try out.appendSlice(allocator, "&#39;"), 315 else => try out.append(allocator, ch), 316 } 317 } 318 } 319