From ee5fbe13451734b727db48bf5b8b637598d7b1b9 Mon Sep 17 00:00:00 2001 From: Alesandro Ortiz Date: Thu, 11 Nov 2021 23:56:30 -0500 Subject: [PATCH 1/2] Update highlight.js version (breaking change) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index aadf0a1..702fdfd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eleventy-plugin-highlightjs", - "version": "1.1.0", + "version": "2.0.0", "description": "", "main": ".eleventy.js", "scripts": { @@ -17,6 +17,6 @@ }, "homepage": "https://github.com/alesandroortiz/eleventy-plugin-highlightjs#readme", "dependencies": { - "highlight.js": "^10.1.1" + "highlight.js": "^11.3.1" } } From 48f1ded7caef8d337b8c83f456b42e48935b682a Mon Sep 17 00:00:00 2001 From: Alesandro Ortiz Date: Thu, 11 Nov 2021 23:59:10 -0500 Subject: [PATCH 2/2] Update highlight.js API usage Per https://github.com/highlightjs/highlight.js/issues/2277 --- src/markdownSyntaxHighlight.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/markdownSyntaxHighlight.js b/src/markdownSyntaxHighlight.js index 60519f6..f592065 100644 --- a/src/markdownSyntaxHighlight.js +++ b/src/markdownSyntaxHighlight.js @@ -17,8 +17,8 @@ module.exports = function(str, language) { html = str; } else { html = 'test'; - html = hljs.highlight(language, str).value; + html = hljs.highlight(str, {language: language}).value; } return `
${html}
`; -}; \ No newline at end of file +};