(content: string)
| 378 | } |
| 379 | |
| 380 | export function splitFrontmatterAndBody(content: string): { |
| 381 | frontmatter: string | null; |
| 382 | body: string; |
| 383 | } { |
| 384 | if (content.startsWith("---")) { |
| 385 | const match = content.match(/^---\s*\r?\n([\s\S]*?)\r?\n---\s*\r?\n?([\s\S]*)$/); |
| 386 | if (match) { |
| 387 | return { |
| 388 | frontmatter: match[1], |
| 389 | body: match[2] || "", |
| 390 | }; |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | return { |
| 395 | frontmatter: null, |
| 396 | body: content, |
| 397 | }; |
| 398 | } |
| 399 | |
| 400 | /** |
| 401 | * Resets all checked markdown checkboxes to unchecked in the given content. |
no outgoing calls
no test coverage detected