normalizeFrontmatterSource #

Rewrites a source whose frontmatter is a JSON object into the frontmatter form the Markdown pipeline reads. Any other source is returned unchanged.

Usage #

TypeScript
import { 
normalizeFrontmatterSource
} from 'kawapress'
const
md
=
normalizeFrontmatterSource
('{"title":"Hi"}\n\n# Hi')

Parameters

sourcestring

The Markdown source of a page.

Returns The source with YAML-style --- frontmatter.

Full type signature
TypeScript
function normalizeFrontmatterSource(source: string): string

Edit this page

Comments