Skip to content

fix(metadata): ensure YAML frontmatter is captured when preceding first heading#735

Open
moshams272 wants to merge 3 commits intonodejs:mainfrom
moshams272:fix/yaml-frontmatter-detection
Open

fix(metadata): ensure YAML frontmatter is captured when preceding first heading#735
moshams272 wants to merge 3 commits intonodejs:mainfrom
moshams272:fix/yaml-frontmatter-detection

Conversation

@moshams272
Copy link
Copy Markdown
Contributor

@moshams272 moshams272 commented Mar 30, 2026

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

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@moshams272 moshams272 requested a review from a team as a code owner March 30, 2026 21:38
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Mar 31, 2026 2:14pm

Request Review

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

AugustinMauroy

This comment was marked as duplicate.

Copy link
Copy Markdown
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add test for theses cases

Removed test case for parsing without top-level frontmatter.
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.

3 participants