Skip to content

fix: don't crash on empty frontmatter#7

Merged
wooorm merged 4 commits intovfile:mainfrom
GauBen:patch-1
Mar 19, 2025
Merged

fix: don't crash on empty frontmatter#7
wooorm merged 4 commits intovfile:mainfrom
GauBen:patch-1

Conversation

@GauBen
Copy link
Contributor

@GauBen GauBen commented Mar 18, 2025

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything or linked relevant results below
  • I made sure the docs are up to date
  • I included tests (or that’s not needed)

Description of changes

Hey!

Small fix in case someone tries to parse an empty frontmatter:

----
----

I'm a file

In this case, match[1] is undefined, so fallback to an empty string

Hey!

Small fix in case someone tries to parse an empty frontmatter:

```md
----
----

I'm a file
```

In this case, match[1] is undefined, so fallback to an empty string

Signed-off-by: Gautier Ben Aïm <48261497+GauBen@users.noreply.github.com>
@github-actions github-actions bot added the 👋 phase/new Post is being triaged automatically label Mar 18, 2025
@github-actions

This comment has been minimized.

@github-actions github-actions bot added 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Mar 18, 2025
Signed-off-by: Titus <tituswormer@gmail.com>
@wooorm wooorm merged commit 60ac33e into vfile:main Mar 19, 2025
4 checks passed
@github-actions

This comment has been minimized.

@wooorm wooorm added 💪 phase/solved Post is done 🐛 type/bug This is a problem labels Mar 19, 2025
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Mar 19, 2025
@wooorm
Copy link
Member

wooorm commented Mar 19, 2025

Thanks, released in https://github.com/vfile/vfile-matter/releases/tag/5.0.1!

@GauBen
Copy link
Contributor Author

GauBen commented Mar 19, 2025

Thanks!

bfdes added a commit to bfdes/bfdes.in that referenced this pull request Mar 22, 2025
bfdes added a commit to bfdes/bfdes.in that referenced this pull request Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 phase/solved Post is done 🐛 type/bug This is a problem

Development

Successfully merging this pull request may close these issues.

3 participants

Comments