fix: prevent spurious 'metadata: {}' in frontmatter output (#530)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Paul Hernandez
2026-01-31 12:17:10 -06:00
committed by GitHub
parent 8f962fdd87
commit e3ced49d9d
2 changed files with 95 additions and 1 deletions
+3 -1
View File
@@ -241,7 +241,9 @@ class EntityParser:
f"Failed to parse YAML frontmatter in {file_path}: {e}. "
f"Treating file as plain markdown without frontmatter."
)
post = frontmatter.Post(content, metadata={})
# Use Post(content) not Post(content, metadata={})
# The latter creates {"metadata": {}} in the metadata dict (issue #528)
post = frontmatter.Post(content)
# Normalize frontmatter values
metadata = normalize_frontmatter_metadata(post.metadata)