(text)
| 358 | } |
| 359 | |
| 360 | function extractCodeFences(text) { |
| 361 | const fences = []; |
| 362 | const regex = /(^|\n)(`{3,})([^\n]*)\n([\s\S]*?)\n\2(?=\n|$)/g; |
| 363 | let match = regex.exec(text); |
| 364 | while (match) { |
| 365 | fences.push({ |
| 366 | fence: match[2], |
| 367 | language: (match[3] || '').trim(), |
| 368 | content: match[4] |
| 369 | }); |
| 370 | match = regex.exec(text); |
| 371 | } |
| 372 | return fences; |
| 373 | } |
| 374 | |
| 375 | function normalizeCodeLanguage(language) { |
| 376 | const value = String(language || '').trim().toLowerCase(); |
no outgoing calls
no test coverage detected