Skip to content

fix(report): keep evidence inside its code block when it contains a fence - #832

Open
hakarrr wants to merge 1 commit into
BaaRai:mainfrom
hakarrr:fix-evidence-fence
Open

hakarrr wants to merge 1 commit into
BaaRai:mainfrom
hakarrr:fix-evidence-fence

Conversation

@hakarrr

@hakarrr hakarrr commented Dec 2, 2026

Copy link
Copy Markdown

Problem

The summary report, the single-finding export and the task report print a finding's evidence (or PoC) inside a fixed three-backtick code fence. Evidence is often captured target output: a response body, a README, a model reply. When it contains its own ``` line, the block closes early and the rest of the evidence is rendered as live Markdown (headings, links, images) in the exported report.

Change

Add fencedBlock, which uses a fence one backtick longer than the longest backtick run in the text (minimum three). The three places that printed evidence use it. Output for evidence with no backticks is byte-for-byte the same.

Tested

  • New TestEvidenceWithBacktickFenceStaysInBlock covers the summary and single-finding exports. It fails on current main and passes with the change.
  • go test ./report, gofmt.

…ence

Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant