* Strip fenced code blocks (``` ... ```) and inline `code` spans from markdown. * Prevents false positives when extracting questions, people, etc. from prose.
(content: string)
| 149 | * Prevents false positives when extracting questions, people, etc. from prose. |
| 150 | */ |
| 151 | function stripCodeBlocks(content: string): string { |
| 152 | // Remove fenced code blocks (``` ... ``` or ~~~ ... ~~~), including language tags |
| 153 | let stripped = content.replace(/^```[\s\S]*?^```/gm, "").replace(/^~~~[\s\S]*?^~~~/gm, ""); |
| 154 | // Remove inline code spans (`...`) |
| 155 | stripped = stripped.replace(/`[^`\n]+`/g, "``"); |
| 156 | return stripped; |
| 157 | } |
| 158 | |
| 159 | // ─── Open Question Extraction ───────────────────────────────────────────────── |
| 160 |
no outgoing calls
no test coverage detected