Skip to content

Commit 3234ca1

Browse files
authored
updates highlight to ^10.0.0 (#205)
Highlight 10.0.0 contained a breaking change that impacts markdown-pdf. This change updates the dependency in `package.json` and makes the small change to switch the order of arguments for `hljs.highlight`.
1 parent 5bdda51 commit 3234ca1

File tree

4 files changed

+4216
-19
lines changed

4 files changed

+4216
-19
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ function markdownpdf (opts) {
4141
var self = this
4242

4343
var mdParser = new Remarkable(opts.remarkable.preset, extend({
44-
highlight: function (str, lang) {
45-
if (lang && hljs.getLanguage(lang)) {
44+
highlight: function (str, language) {
45+
if (language && hljs.getLanguage(language)) {
4646
try {
47-
return hljs.highlight(lang, str).value
47+
return hljs.highlight(str, { language }).value
4848
} catch (err) {}
4949
}
5050

0 commit comments

Comments
 (0)