feat(sdk): strip fenced code blocks before UAT item scan (#3184)

Cycle 6 of ~15: adds fenced-block stripping pass to
stripMarkdownInjection. Docs-and-examples inside code fences
no longer pollute the item roster.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-18 22:45:47 -04:00
parent a38fa6c7a6
commit 3c0490c021
2 changed files with 38 additions and 0 deletions

View File

@@ -43,6 +43,8 @@ interface UatItem {
function stripMarkdownInjection(content: string): string {
// Pass 1: strip YAML frontmatter region (---\n...\n---)
let s = content.replace(/^---\r?\n[\s\S]*?\r?\n---/m, '');
// Pass 2: strip fenced code blocks (``` ... ```)
s = s.replace(/```[\s\S]*?```/g, '');
return s;
}