diff --git a/ui/logview.html b/ui/logview.html
index e5dc7a4..0e35028 100644
--- a/ui/logview.html
+++ b/ui/logview.html
@@ -158,13 +158,15 @@
const lines = text.split("\n");
let pass = 0, fail = 0, skip = 0;
- function renderLine(line) {
+ function renderLine(line, i) {
const cls = classify(line);
if (cls === "ln-pass") pass++;
else if (cls === "ln-fail") fail++;
else if (cls === "ln-skip") skip++;
const e = esc(line);
- return cls ? `${e}` : e;
+ const c = cls ? `class=${cls}` : ``;
+ if (this.add) i += this.add;
+ return `${e}`;
}
// Group runs of deeply-nested "# #" diagnostic lines into a foldable
@@ -177,13 +179,13 @@
if (foldable(lines[i])) {
let j = i;
while (j < lines.length && foldable(lines[j])) j++;
- const body = lines.slice(i, j).map(renderLine).join("\n");
+ const body = lines.slice(i, j).map(renderLine, {add: i}).join("\n");
pieces.push(
`${j - i} lines` +
`\n${body}`);
i = j;
} else {
- pieces.push(renderLine(lines[i]));
+ pieces.push(renderLine(lines[i], i, {add: 0}));
i++;
}
}
@@ -199,6 +201,11 @@
out.addEventListener("click", e => {
const t = e.target.closest(".fold-toggle");
if (t) t.parentElement.classList.toggle("open");
+
+ // Set #Line in url
+ var id = e.target.id;
+ if (id && id.startsWith("L"))
+ history.pushState(null, null, "#" + id);
});
// Fold/unfold all button.