{cls._escape_html(finding['title'])}
+{cls._escape_html(finding['category'])} | {cls._escape_html_with_breaks(finding['target'] or target)}
+Description
+{cls._escape_html(finding['description'])}
+From 206ea6f155716ac4e4ce4f63efc9fb89e477b34d Mon Sep 17 00:00:00 2001 From: Rohit Kattimani <82595800+RohitKattimani@users.noreply.github.com> Date: Fri, 29 May 2026 22:06:57 +0530 Subject: [PATCH 1/4] Refactor report generation and markup structure Refactor HTML report generation to use icon mapping and improve markup structure. --- backend/secuscan/reporting.py | 371 ++++++++++++++++++---------------- 1 file changed, 196 insertions(+), 175 deletions(-) diff --git a/backend/secuscan/reporting.py b/backend/secuscan/reporting.py index fb2e8987..2afc4b81 100644 --- a/backend/secuscan/reporting.py +++ b/backend/secuscan/reporting.py @@ -284,46 +284,108 @@ def _format_timestamp(value: str) -> str: return value @classmethod + def _build_pdf_finding_markup(cls, finding: Dict[str, Any], target: str, critical_icon: str) -> str: + evidence_html = f"
{cls._escape_html(finding['proof'])}" if finding['proof'] else ""
+ remediation_html = f"{cls._escape_html(finding['remediation'])}
+ {cls._escape_html(finding['title'])}+{cls._escape_html(finding['category'])} | {cls._escape_html_with_breaks(finding['target'] or target, " ")} + |
+
{cls._escape_html(finding['description'])}
+ {evidence_html} + {remediation_html} + {cve_html} +{cls._escape_html(finding['proof'])}{cls._escape_html(finding['remediation'])}
{cls._escape_html(finding['category'])} | {cls._escape_html_with_breaks(finding['target'] or target)}
+{cls._escape_html(finding['description'])}
+
- {cls._escape_html(finding['title'])}-{cls._escape_html(finding['category'])} | {cls._escape_html_with_breaks(finding['target'] or payload['target'], " ")} - |
-
{cls._escape_html(finding['description'])}
- {f"{cls._escape_html(finding['proof'])}" if finding['proof'] else ""}
- {f"{cls._escape_html(finding['remediation'])}
|
SecuScan security export
{target_html}@@ -546,17 +608,17 @@ def _generate_pdf_html_report(cls, task: Dict[str, Any], result: Dict[str, Any])
+ |
| {cls._escape_html(payload['task_id'] or 'Unknown')} | @@ -568,70 +630,42 @@ def _generate_pdf_html_report(cls, task: Dict[str, Any], result: Dict[str, Any])