Repository navigation
Return every stacked block's properties from ExtractFrontmatter [patch] - #201
Merged
Merged
Conversation
ExtractBody, RemoveFrontmatter and AddFrontmatter treat consecutive frontmatter blocks as one header, but ExtractFrontmatter returned only the first block, so a later block's properties were in neither the extracted frontmatter nor the body. Fold every block the way AddFrontmatter does, so the first block to define a key wins. Fixes #169 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MupvoiQ9WM1vUJoCzYJ6W
|
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



ExtractBody,RemoveFrontmatterandAddFrontmatteralready treat consecutive frontmatter blocks as one header (#138 / #166).ExtractFrontmatter, though, still returned only the first block. So in---\ntitle: Hello\n---\n---\nauthor: Jane\n---\n# Body,author: Janeshowed up in neither the extracted frontmatter nor the body.ExtractFrontmatternow folds every block throughCombineAllFrontmatterObjects, the same foldAddFrontmatteruses, so the first block to define a key wins. It still returns null when nothing parses. Single-block documents are unaffected.Tests in
StackedBlockPreservationTests:titleandauthor, and its body is# Body.AddFrontmatter_StackedBlocksRepeatAKey_FirstBlockWins.Without the fix, both new tests fail. With it, the full suite passes (299/299).
Fixes #169
🤖 Generated with Claude Code
https://claude.ai/code/session_019MupvoiQ9WM1vUJoCzYJ6W
Generated by Claude Code