Skip to content

Commit

Permalink
Fix highlightjs deprecation
Browse files Browse the repository at this point in the history
Fixes #882
  • Loading branch information
RobbieTheWagner committed Jun 21, 2021
1 parent 761f337 commit 20cd7ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addon/utils/compile-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ hljs.registerLanguage('ts', typescript);
@param {string} snippet Snippet of code
@param {string} lang Language to use for syntax highlighting
*/
export function highlightCode(code, lang) {
return hljs.getLanguage(lang) ? hljs.highlight(lang, code).value : code;
export function highlightCode(code, language) {
return hljs.getLanguage(language)
? hljs.highlight(code, { language }).value
: code;
}

/**
Expand Down

0 comments on commit 20cd7ef

Please sign in to comment.