Skip to main content

Module frontmatter

Module frontmatter 

Source
Expand description

Minimal frontmatter parser (deliberately NOT full YAML).

Ports typescript/src/shared/frontmatter.ts exactly, including the backtracking behavior of the reference regex ^---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$).

Functionsยง

parse_frontmatter
Parse key: value lines out of the frontmatter block. Each line is split at the FIRST :; keys and values are trimmed; one pair of matching surrounding quotes is stripped from the value (then trimmed again); lines without a : or with an empty key/value are skipped.