Skip to content

Conversation

@Trott
Copy link
Contributor

@Trott Trott commented Mar 20, 2022

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

I tested this on Node.js 8 and Node.js 16 and the tests passed for both.
@Trott
Copy link
Contributor Author

Trott commented Mar 20, 2022

(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
Copy link

wernerglinka commented Mar 20, 2022

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
Copy link
Contributor Author

Trott commented Mar 20, 2022

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
Copy link

wernerglinka commented Mar 20, 2022

Arg, thanks for responding and setting me straight 😕

@webketje webketje merged commit 845077f into metalsmith:master Mar 20, 2022
@webketje
Copy link
Member

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

@Trott Trott deleted the Trott-patch-1 branch March 20, 2022 22:48
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

Successfully merging this pull request may close these issues.

3 participants