Skip to content

fix(ui): parse nested frontmatter maps and arrays of maps - #1548

Open
FNDEVVE wants to merge 1 commit into
backnotprop:mainfrom
FNDEVVE:fix/1485-frontmatter-nested
Open

FNDEVVE wants to merge 1 commit into
backnotprop:mainfrom
FNDEVVE:fix/1485-frontmatter-nested

Conversation

@FNDEVVE

@FNDEVVE FNDEVVE commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

extractFrontmatter trimmed every line, so indented child keys (generated:/by:/at:, verified:/sources: arrays of maps) hoisted to the document root, where same-named keys clobbered each other and the card rendered wrong-but-complete-looking values.

The parser is now indentation-aware: nested maps stay grouped, arrays of maps group per item, and flat scalars, string arrays, block scalars (|/>), and CRLF all behave as before. FrontmatterCard renders nested structures recursively (flat frontmatter renders exactly as today).

Testing: bun test packages/ui/utils/parser.test.ts (197 pass, incl. 6 new nested-structure tests + regressions), full bun run typecheck clean.

Closes #1485.

extractFrontmatter hoisted indented child keys to the root, clobbering same-named keys and rendering wrong values.

Parse nested maps and arrays of maps; flat frontmatter renders byte-identically.

Closes backnotprop#1485.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotate: frontmatter card shows wrong values when the YAML has nested keys

1 participant