fix(metadata): ensure YAML frontmatter is captured when preceding first heading#735
Open
moshams272 wants to merge 3 commits intonodejs:mainfrom
Open
fix(metadata): ensure YAML frontmatter is captured when preceding first heading#735moshams272 wants to merge 3 commits intonodejs:mainfrom
moshams272 wants to merge 3 commits intonodejs:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AugustinMauroy
requested changes
Mar 31, 2026
AugustinMauroy
approved these changes
Mar 31, 2026
avivkeller
approved these changes
Mar 31, 2026
avivkeller
reviewed
Mar 31, 2026
Removed test case for parsing without top-level frontmatter.
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.
Description
As doc-kit support standard YAML that used to be written in the top of file, we need the parser to read it.
After debuging I observe that the parser starts from the first heading and ignore the YAML, so I let him now to get the YAML as if it will get the first child don't start from the first line that child begin, just start from begining of the file, after that YAML got merged in metadata and cleared from file and continue scanning the first child as from the first heading.
Validation
I added tests.
Related Issues
there is no Issues, just some tracing to get standard YAML done to pass frontmatter data to layout component.
Check List
node --run testand all tests passed.node --run format&node --run lint.