Skip to content

.matter is not cached properly #174

Open
@nwhitehead

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions