MCPcopy
hub / github.com/callumalpass/tasknotes / splitFrontmatterAndBody

Function splitFrontmatterAndBody

src/utils/helpers.ts:380–398  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

378}
379
380export 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.

Callers 4

updateTaskMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected