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

[Bug] Running render on markdown without meta will return meta from the previous run #5

Open
lil5 opened this issue Jul 8, 2021 · 3 comments

Comments

@lil5
Copy link

lil5 commented Jul 8, 2021

Example:

const MarkdownIt = require('markdown-it')
const meta = require('markdown-it-meta')

// Make new instance
const md = new MarkdownIt()
// Add markdown-it-meta
md.use(meta)

let renderedDocument1 =  md.render('---\nfoo: true\n---\n# Foo')
let result1 = {
  document: renderedDocument1,
  meta: {...md.meta}
}

let renderedDocument2 =  md.render('# Fee')
let result2 = {
  document: renderedDocument2,
  meta: {...md.meta}
}

console.log("Result 1", result1)
console.log("Result 2", result2)
  • result1.meta will be have an expected value of {foo: true}
  • result2.meta should have a value of {} but 🐜 it does not and instead returns {foo: true}
@lil5
Copy link
Author

lil5 commented Jul 8, 2021

@scott-wyatt
Copy link
Member

Thanks for the PR! I'll take a look as soon as I can, I apologize for the slow turn around, we didn't realize this library was picking up momentum.

@lil5
Copy link
Author

lil5 commented Jul 10, 2021

Looking forward to any questions or advised alterations 😉

In terms of momentum, I can only speak for myself 🤷‍♂️ idk

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

2 participants