Skip to content

Commit d6f6571

Browse files
Fix highlightjs deprecation (#891)
Fixes #882
1 parent 701b2c6 commit d6f6571

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

addon/utils/compile-markdown.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ hljs.registerLanguage('ts', typescript);
6363
@param {string} snippet Snippet of code
6464
@param {string} lang Language to use for syntax highlighting
6565
*/
66-
export function highlightCode(code, lang) {
67-
return hljs.getLanguage(lang) ? hljs.highlight(lang, code).value : code;
66+
export function highlightCode(code, language) {
67+
return hljs.getLanguage(language)
68+
? hljs.highlight(code, { language }).value
69+
: code;
6870
}
6971

7072
/**

0 commit comments

Comments
 (0)