markmeta
v0.0.1
Published
Split markdown metadata
Downloads
2
Readme
markmeta
Get the metadata in markdown
import { splitMarkdown } from "markmeta";
// Returns [metadata object, metadata text, content after metadata]
splitMarkdown(`---
title: Title
---
## content
`);
// [{ title: "Title" }, "---\ntitle: Title\n---", "\n\n## content\n"]
splitMarkdown(`---
{
"title": "Title"
}
---
## content
`);
// [{ title: "Title" }, `---\n{\n "title": "Title"\n}\n---`, "\n\n## content\n"]
splitMarkdown(`+++
title= Title
+++
## content
`);
// [{ title: "Title" }, `+++\ntitle= Title\n+++`, "\n\n## content\n"]