MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / parseFrontMatter

Function parseFrontMatter

scripts/lib/changesets.ts:39–49  ·  view source on GitHub ↗
(markdown: string)

Source from the content-addressed store, hash-verified

37}
38
39export function parseFrontMatter(markdown: string) {
40 const match = markdown.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
41 if (!match) {
42 return { frontMatter: null, content: markdown };
43 }
44
45 return {
46 frontMatter: match[1],
47 content: match[2],
48 };
49}
50
51const DOCS_URL_PATTERN =
52 /^\s*#\s*docs:\s*(https?:\/\/github\.com\/NomicFoundation\/hardhat-website\/pull\/\d+)/i;

Callers 4

collectDocsUrlsFunction · 0.90
changesets.test.tsFile · 0.90
readAllNewChangsetsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected