From c3d8f0171cab00372d2fced843c2c4f61460dcf2 Mon Sep 17 00:00:00 2001 From: biosias Date: Tue, 22 Sep 2026 16:02:38 +0200 Subject: [PATCH] Fix blank line silently dropping YAML block arrays (AI) A blank line between a block-array key and its "- item" lines matched neither the item nor the key regex, resetting arrayKey to null and causing the following items to be silently skipped. Blank lines are now ignored instead of ending the array. Co-Authored-By: Claude Sonnet 5 --- js/frontmatter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/frontmatter.js b/js/frontmatter.js index 8a7c643..de50486 100644 --- a/js/frontmatter.js +++ b/js/frontmatter.js @@ -39,6 +39,7 @@ export function parseFrontmatter(raw) { const meta = {}; let arrayKey = null; for (const line of match[1].split(/\r?\n/)) { + if (!line.trim()) continue; // blank line — doesn't close a block array const item = line.match(/^\s*-\s+(.*)$/); if (item && arrayKey) { meta[arrayKey].push(parseScalar(item[1])); continue; } const field = line.match(/^([A-Za-z][A-Za-z0-9_-]*):(?:\s*(.*))?$/);