From a14c7944d87b30ed7bfecd4bad06562e24002b01 Mon Sep 17 00:00:00 2001 From: ezl-keygraph Date: Wed, 30 Sep 2026 19:49:51 +0530 Subject: [PATCH] feat: link finding IDs in the PDF report to their detail sections (#474) --- apps/worker/templates/typst/report.typ | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/worker/templates/typst/report.typ b/apps/worker/templates/typst/report.typ index 9a31e1fa..c5f82ff0 100644 --- a/apps/worker/templates/typst/report.typ +++ b/apps/worker/templates/typst/report.typ @@ -128,6 +128,9 @@ text(fill: white, weight: "bold", size: 7.5pt, tracking: 0.3pt, upper(label)), ) +#let finding-anchor(id) = label("finding-" + id) +#let finding-link(id) = link(finding-anchor(id), text(weight: "semibold")[#id]) + #let categories-in-order = if mode == "exploits" { data.exploitedByType.map(entry => entry.category) } else { @@ -338,7 +341,7 @@ #if "bullets" in entry and entry.bullets != none [ #list( ..entry.bullets.map(b => [ - #text(weight: "semibold")[#b.id] — #inline-code(b.description) + #finding-link(b.id) — #inline-code(b.description) ]) ) ] @@ -474,7 +477,7 @@ ..(if show-confidence-col { (text(size: 9.5pt, weight: "semibold")[Confidence],) } else { () }), ), ..data.findings.map(f => ( - text(weight: "semibold")[#f.id], + finding-link(f.id), inline-code(f.title), text(size: 9.5pt)[#f.category], sev-chip(f.severity), @@ -531,7 +534,7 @@ #let render-exploit(f) = { block(breakable: false)[ - #heading(level: 2)[#f.id: #inline-code(f.title)] + #heading(level: 2)[#f.id: #inline-code(f.title)]#finding-anchor(f.id) #sev-chip(f.severity) #v(8pt) #render-finding-owasp(f) @@ -553,7 +556,7 @@ #let render-analysis(f) = { block(breakable: false)[ - #heading(level: 2)[#f.id: #inline-code(f.title)] + #heading(level: 2)[#f.id: #inline-code(f.title)]#finding-anchor(f.id) #sev-chip(f.severity) #h(4pt) #confidence-chip(f.confidence)