diff --git a/ui/components/findings/table/resource-detail-drawer/resource-detail-drawer-content.tsx b/ui/components/findings/table/resource-detail-drawer/resource-detail-drawer-content.tsx index c9ce35cf3b..b2e9aae49d 100644 --- a/ui/components/findings/table/resource-detail-drawer/resource-detail-drawer-content.tsx +++ b/ui/components/findings/table/resource-detail-drawer/resource-detail-drawer-content.tsx @@ -65,6 +65,11 @@ import { getRegionFlag } from "@/lib/region-flags"; import { Muted } from "../../muted"; import { DeltaIndicator } from "../delta-indicator"; + +/** Strip markdown code fences (```lang ... ```) so CodeSnippet shows clean code. */ +function stripCodeFences(code: string): string { + return code.replace(/^```\w*\n?/, "").replace(/\n?```\s*$/, "").trim(); +} import { NotificationIndicator } from "../notification-indicator"; import { ResourceDetailSkeleton } from "./resource-detail-skeleton"; import type { CheckMeta } from "./use-resource-detail-drawer"; @@ -448,7 +453,7 @@ export function ResourceDetailDrawerContent({ CLI Command: