Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Aaron Powell
2026-06-12 12:02:19 +10:00
committed by GitHub
parent 372b845dce
commit 1c72b5f2f2
+8 -2
View File
@@ -270,9 +270,15 @@ function toMarkdownReport(findings, scannedFiles, skippedFiles) {
: finding.severity === severityLevels.medium
? "🟠"
: "️";
const match = finding.match.replace(/\|/g, "\\|");
const match = finding.match
.replace(/\\/g, "\\\\")
.replace(/`/g, "\\`")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/\|/g, "\\|")
.replace(/@/g, "@\u200b");
summary.push(
`| ${severity} | \`${finding.rule_id}\` | \`${finding.file}\` | ${finding.line} | ${match} |`
`| ${severity} | \`${finding.rule_id}\` | \`${finding.file}\` | ${finding.line} | \`${match}\` |`
);
}