MCPcopy Create free account
hub / github.com/Drakkar-Software/OctoBot / stripFrontmatter

Function stripFrontmatter

docs/scripts/shared.mjs:61–66  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

59
60/** Strip leading YAML frontmatter (--- ... ---) from markdown content. */
61export function stripFrontmatter(content) {
62 if (!content.startsWith('---')) return content;
63 const endIdx = content.indexOf('---', 3);
64 if (endIdx === -1) return content;
65 return content.substring(endIdx + 3).trim();
66}
67
68/**
69 * Recursively find all .md files under a directory.

Callers 2

processFileFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected