Background
parseFrontmatterKeys in scripts/notion-translate/translateFrontMatter.ts uses a regex to extract YAML keys from frontmatter blocks. The function comment acknowledges the limitation:
"Only recognises simple `key:` entries (no nested parsing) — enough to detect dropped or added keys without pulling in a YAML parser dependency."
This means it will silently misparse quoted keys, flow sequences, or multi-line scalars.
What to do
Evaluate adding a lightweight YAML parser (e.g. yaml, already a transitive dependency in many Node projects) to replace the regex approach in parseFrontmatterKeys and replaceFrontmatterValue.
Alternatively, if the current regex coverage is deemed sufficient for the narrow set of frontmatter shapes Notion generates, add explicit documentation and a test asserting the known limitations so future contributors don't assume full YAML support.
Background
parseFrontmatterKeysinscripts/notion-translate/translateFrontMatter.tsuses a regex to extract YAML keys from frontmatter blocks. The function comment acknowledges the limitation:This means it will silently misparse quoted keys, flow sequences, or multi-line scalars.
What to do
Evaluate adding a lightweight YAML parser (e.g.
yaml, already a transitive dependency in many Node projects) to replace the regex approach inparseFrontmatterKeysandreplaceFrontmatterValue.Alternatively, if the current regex coverage is deemed sufficient for the narrow set of frontmatter shapes Notion generates, add explicit documentation and a test asserting the known limitations so future contributors don't assume full YAML support.