(text: string)
| 60 | * @returns The content inside the %%% block, or null if not found. |
| 61 | */ |
| 62 | export function extractImageRequest(text: string): string | null { |
| 63 | const imageRequestRegex = /%%%\s*\n?([\s\S]*?)\n?%%%/; |
| 64 | const match = text.match(imageRequestRegex); |
| 65 | return match && match[1] ? match[1].trim() : null; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Extracts the detection mode template from a string. |