* Extract the first heading from markdown content.
(markdown: string)
| 37 | * Extract the first heading from markdown content. |
| 38 | */ |
| 39 | function extractFirstHeading(markdown: string): string | null { |
| 40 | const match = markdown.match(/^#\s+(.+)$/m); |
| 41 | if (!match) return null; |
| 42 | return match[1].trim(); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Generate a slug from plan content. |