jonschlinkert / gray-matter

Smarter YAML front matter parser, used by metalsmith, Gatsby, Netlify, Assemble, mapbox-gl, phenomic, vuejs vitepress, TinaCMS, Shopify Polaris, Ant Design, Astro, hashicorp, garden, slidev, saber, sourcegraph, and many others. Simple to use, and battle tested. Parses YAML by default but can also parse JSON Front Matter, Coffee Front Matter, TOML Front Matter, and has support for custom parsers. Please follow gray-matter's author: https://github.com/jonschlinkert
https://github.com/jonschlinkert
MIT License
3.91k stars 138 forks source link

Some kind of unwanted caching behaviour? #159

Open james-tindal opened 1 year ago

james-tindal commented 1 year ago

GrayMatter is giving me the output for a previous input instead of the actual input. This Codesandbox behaves normally

import GrayMatter from "gray-matter";
console.log(
  GrayMatter(
    "---\nmarkmap:\n  coloring: single\n---\n\n```markmap\n---\nmarkmap:\n  height: 249\n---\n# Housework\n## Main\n- [x] Dishes\n- [ ] Cleaning the bathroom\n- [ ] Change the light bulbs\n- [ ] something else\n## [x] Also work on titles\n```\n\nd\n"
  ).data
);

Output: { markmap: { coloring: 'single' }

However, if I copy and paste the same code into my Electron console,

image

So far, I can't replicate this in a simpler form.

If I change one character in the input string, it returns a normal answer.