Recommended action
${recommendedActionHtml}
+
Risk summary
+
${escapeHtml(finding.riskSummary)}
+
Next action
+
${escapeHtml(finding.nextAction)}
diff --git a/src/output/multi-folder-html-reporter.ts b/src/output/multi-folder-html-reporter.ts
index 6010116..e576c31 100644
--- a/src/output/multi-folder-html-reporter.ts
+++ b/src/output/multi-folder-html-reporter.ts
@@ -1,11 +1,17 @@
import fs from "node:fs";
import path from "node:path";
import type { MultiFolderScanResult } from "../scan/multi-folder-scan.js";
-import { REPORT_STYLES, escapeHtml, renderFindingRow, renderFixPlan, openInBrowser } from "./html-reporter.js";
+import {
+ REPORT_STYLES,
+ escapeHtml,
+ openInBrowser,
+ renderFindingRow,
+ renderFixPlan,
+ serializeHtmlFinding,
+} from "./html-reporter.js";
import type { SerializedFinding } from "./html-reporter.js";
import { LOGO_BASE64 } from "./logo-base64.js";
import { OWASP_LOGO_BASE64 } from "./owasp-logo-base64.js";
-import { serializeFinding } from "./formatters.js";
import { pluralize } from "../utils/string.js";
import type { SeverityLabel } from "../types.js";
@@ -124,7 +130,7 @@ export async function writeMultiFolderHtmlReport(params: {
// Pre-serialize findings once per folder for both HTML rendering and JS filter/sort
const allSerialized: SerializedFinding[][] = params.results.map(r =>
- r.sorted.map(f => serializeFinding(f, r.suggestedFixCommands)),
+ r.sorted.map(f => serializeHtmlFinding(f, r.suggestedFixCommands)),
);
// Compact per-folder findings for JavaScript (only fields needed for filter/sort/search)
diff --git a/tests/html-reporter.test.ts b/tests/html-reporter.test.ts
index b976086..f5a4899 100644
--- a/tests/html-reporter.test.ts
+++ b/tests/html-reporter.test.ts
@@ -151,6 +151,85 @@ describe("renderHtmlReport", () => {
expect(renderHtmlReport(data)).toContain("1.8.0");
});
+ it("shows contextual risk and next-action guidance for direct findings", () => {
+ const html = renderHtmlReport(data);
+ const recommendedActionIdx = html.indexOf("