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

Update highlight.js examples to new, preferred, calling convention. #779

Closed
wants to merge 1 commit into from

Conversation

kindid
Copy link

@kindid kindid commented Apr 22, 2021

See highlightjs/highlight.js#2277

This prevents the message "Deprecated as of 10.7.0. highlight(lang, code, ...args) has been deprecated. Deprecated as of 10.7.0. Please use highlight(code, options) instead. highlightjs/highlight.js#2277" from appearing on the console which then appeared in my website as I simple wrote "node index.js > blah.html"!

@@ -152,7 +152,7 @@ var md = require('markdown-it')({
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, str).value;
return hljs.highlight(str, { language: lang).value;
} catch (__) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems missed }

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

@puzrin
Copy link
Member

puzrin commented Apr 22, 2021

Can i close this and do update myself, including demo?

Demo needs similar changes too https://github.com/markdown-it/markdown-it/blob/master/support/demo_template/index.js#L94 + rebuild

@kindid
Copy link
Author

kindid commented Apr 22, 2021

Hi Puzrin. Sure, feel free! I'm just happy to help. Sorry about the typo!

puzrin pushed a commit that referenced this pull request Apr 22, 2021
@puzrin
Copy link
Member

puzrin commented Apr 22, 2021

Done. Thanks for your help!

@puzrin puzrin closed this Apr 22, 2021
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.

2 participants