metalsmith / markdown

A metalsmith plugin to render markdown files to HTML.
MIT License
63 stars 65 forks source link

chore: update marked@2.1.0 to marked@4.0.12 #57

Closed Trott closed 2 years ago

Trott commented 2 years ago

I tested this on Node.js 8 and Node.js 16 and the tests passed for both.

Trott commented 2 years ago

(Hooray! CI is green. Obviously, this obsoletes the other two open pull requests that updated marked but didn't update the code to accommodate one of the breaking changes in marked 4.0.0.)

wernerglinka commented 2 years ago

Hello @Trott I tried the same thing and the test failed. I had to change line 40 to const str = marked.parse(data.contents.toString(), options) and line 44 to data[key] = marked.parse(data[key].toString(), options)

E.g. changed marked(...) to marked.parse(...)

And then the test passed... test with Node v16.13.0

Trott commented 2 years ago

Hello @Trott I tried the same thing and the test failed. I had to change line 40 to const str = marked.parse(data.contents.toString(), options) and line 44 to data[key] = marked.parse(data[key].toString(), options)

E.g. changed marked(...) to marked.parse(...)

And then the test passed... test with Node v16.13.0

That's because you left out the curly braces in the require statement. Make sure it's this:

const { marked } = require('marked')

...and not this:

const marked = require('marked')

...and you won't need to make those other changes.

wernerglinka commented 2 years ago

Arg, thanks for responding and setting me straight 😕

webketje commented 2 years ago

Thx @Trott tested locally on all supported versions, will release this soon