Extract the YAML frontmatter string (between --- delimiters) from markdown
(markdown: string)
| 12 | |
| 13 | /** Extract the YAML frontmatter string (between --- delimiters) from markdown */ |
| 14 | function extractFrontmatter(markdown: string): string { |
| 15 | const match = markdown.match(/^---\n([\s\S]*?)\n---/); |
| 16 | return match ? match[1] : ""; |
| 17 | } |
| 18 | |
| 19 | /** Extract the markdown body (after the closing ---) */ |
| 20 | function extractBody(markdown: string): string { |
no outgoing calls
no test coverage detected