Skip to content

fix(meta): keep quoted scalars containing ": " in oliver meta output (#120) - #121

Merged
drawmeanelephant merged 1 commit into
mainfrom
fix/meta-quoted-colon-120
Aug 25, 2026
Merged

drawmeanelephant merged 1 commit into
mainfrom
fix/meta-quoted-colon-120

Conversation

@drawmeanelephant

Copy link
Copy Markdown
Owner

Summary

oliver meta silently projected "" for any frontmatter key whose value was a quoted scalar containing : , because the per-field extraction ran the bare-scalar out-of-subset rejects (embedded : , inline comments, leading indicators) before quote decoding. The value never reached decodeScalar, which handles quoted forms correctly — so title: "Has: Colon" produced an empty field and downstream templates rendered an empty $title$ with no signal (#120, originally surfaced via rotkeeper#260).

Fix

Classification now happens inside decodeScalar after the quoted forms, mirroring frontmatter.parseScalar's existing order (src/frontmatter.zig:422): a quoted scalar is opaque data, and only bare scalars reject an embedded : / # / leading indicator. Bare out-of-subset values still project "".

Characterization (from the issue)

Input Before After
title: "Has: Colon" "" Has: Colon
description: "Desc: here" + author: "A: B" all "" all extracted
title: 'Single: Colon' "" Single: Colon
title: "NoSpace:Colon" extracted extracted (unchanged)
title: "Trailing: " "" Trailing: verbatim
title: Unquoted: Colon Value "" "" (still out-of-subset, as pinned)

Tests

  • New meta: quoted scalars may contain ": " (issue #120) covering every row above.
  • New pinning test in frontmatter.zig for the library parse path (--frontmatter yaml was already correct).
  • Full suite green: 455/455 across all seven test steps (zig build test --summary all).

…120)

The per-field extraction checked the bare-scalar out-of-subset rejects
(embedded ": ", inline comments, leading indicators) before attempting
quote decoding, so any quoted scalar containing ": " was projected as
"" — e.g. title: "Has: Colon" rendered an empty $title$ downstream.

Classification now happens inside decodeScalar after the quoted forms,
mirroring frontmatter.parseScalar's order (quoted scalars are opaque;
only bare scalars reject ": "). Bare out-of-subset values still
project "".

Adds regression tests for every row of the issue characterization table
and pins the library parse path in frontmatter.zig.
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.

1 participant