Skip to content
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

.matter is not cached properly #174

Open
nwhitehead opened this issue Sep 23, 2024 · 0 comments
Open

.matter is not cached properly #174

nwhitehead opened this issue Sep 23, 2024 · 0 comments

Comments

@nwhitehead
Copy link

The .matter result property behaves weirdly with caching.

Example:

Welcome to Node.js v21.7.3.
Type ".help" for more information.
> let matter = require('gray-matter');
undefined
> matter('---\ntitle: Title\n---').matter
'\ntitle: Title'
> matter('---\ntitle: Title\n---').matter
undefined

I'm using the .matter property to help map back to precise original source lines (e.g. click in the rendered Markdown to open text editor to right place in source markdown). My workaround right now is to first call matter.clearCache() to always get the .matter property set correctly.

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

No branches or pull requests

1 participant