authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-05 17:48:48-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-07 00:48:32-07:00
log5f5a7b53a4639c618061ee363a513487d2f684c6
treeffb85bb1e8532e132bb18f1f2d82b1007c517f7b
parent1484f174eacb079209c92482d5d9fb360c00c09a

wasm zig source rendering: fix annotation location off-by-one


1 files changed, 1 insertions(+), 1 deletions(-)

lib/docs/wasm/html_render.zig+1-1
...@@ -91,7 +91,7 @@ pub fn fileSourceHtml(...@@ -91,7 +91,7 @@ pub fn fileSourceHtml(
91 while (true) {91 while (true) {
92 if (next_annotate_index >= options.source_location_annotations.len) break;92 if (next_annotate_index >= options.source_location_annotations.len) break;
93 const next_annotation = options.source_location_annotations[next_annotate_index];93 const next_annotation = options.source_location_annotations[next_annotate_index];
94 if (cursor < next_annotation.file_byte_offset) break;94 if (cursor <= next_annotation.file_byte_offset) break;
95 try out.writer(gpa).print("<span id=\"{s}{d}\"></span>", .{95 try out.writer(gpa).print("<span id=\"{s}{d}\"></span>", .{
96 options.annotation_prefix, next_annotation.dom_id,96 options.annotation_prefix, next_annotation.dom_id,
97 });97 });