mirror of
https://github.com/usestrix/strix.git
synced 2026-10-08 03:08:08 +00:00
fix(reports): safe-fence code-location snippets in markdown copy
This commit is contained in:
parent
21243486e2
commit
95d2e5fba9
1 changed files with 3 additions and 1 deletions
|
|
@ -628,7 +628,9 @@ class VulnerabilityDetailScreen(ModalScreen): # type: ignore[misc]
|
|||
if loc.get("label"):
|
||||
lines.append(f" {loc['label']}")
|
||||
if loc.get("snippet"):
|
||||
lines.append(f"```\n{loc['snippet']}\n```")
|
||||
snippet = str(loc["snippet"])
|
||||
snippet_fence = safe_fence(snippet)
|
||||
lines.append(f"{snippet_fence}\n{snippet}\n{snippet_fence}")
|
||||
if loc.get("fix_before") or loc.get("fix_after"):
|
||||
lines.append("**Suggested Fix:**")
|
||||
lines.append("```diff")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue