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

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

Merged
merged 1 commit into from
Mar 20, 2022

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