-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gatsby-plugin-mdx): Do not leak frontmatter into page #35859
Conversation
|
||
code = `${matter ? matter : ``} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When grayMatter
was not passed options prior to this change, matter
would always be undefined
, resulting in no frontmatter rendered to the page. This changes removes matter
entirely from the output node raw body.
Unsure if this is the correct fix since it's unclear to me why matter
was included here in the first place (maybe it is stripped in later code paths?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tracked first introduction of it to ChristopherBiscardi/gatsby-mdx#329 - there is 0 context on it - to me it seem more like debugging code than anything else - the code
is in the MDX format, so it would just output any content put there as content which doesn;t make much sense (to me anyway).
Especially with fact that matter
in returned object means:
file.matter {String}: the raw, un-parsed front-matter string
I don't think we actually want For the behaviour change - In any case, this looks good! |
(cherry picked from commit 5c7e2a6)
(cherry picked from commit 5c7e2a6)
…35913) Co-authored-by: Ty Hopp <[email protected]>
…35912) Co-authored-by: Ty Hopp <[email protected]>
Published in: |
Description
Fix for a recent change that introduced unexpected behavior where mdx frontmatter is rendered into pages.
Documentation
N/A
Related Issues