-
Notifications
You must be signed in to change notification settings - Fork 129
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
handle invalid front-matter errors #243
Conversation
no answer from upstream yet, let's get this merged? |
src/markdown.ts
Outdated
// https://github.com/jonschlinkert/gray-matter/blob/ce67a86dba419381db0dd01cc84e2d30a1d1e6a5/index.js#L225 | ||
// eslint-disable-next-line | ||
// @ts-ignore | ||
matter.clearCache!(); |
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.
is this an undocumented method? I don't see it in the types... (but I see the code in your comment)
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.
it is! I'd prefer for them to fix that bug, but in the meantime it's the best I can do
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.
do we really want to throw instead of just logging the error? The rest of the page should render 🤔
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.
You can bypass the cache by passing in empty options:
So let’s do that. Then you won’t need the try catch or clearCache
call.
Revert unrelated change.
closes #215
or just wait and see if jonschlinkert/gray-matter#166 is closed?