From 1eea135a9dbc74d9b0277cee4285fdbf3ab77cfa Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Sat, 5 Jun 2021 22:21:54 +0200 Subject: [PATCH] Replace deprecated highlight.js syntax (#1295) Signed-off-by: Erik Michelson --- .../highlighted-fence/highlighted-code/highlighted-code.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-code/highlighted-code.tsx b/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-code/highlighted-code.tsx index a1c389939..cd48568bd 100644 --- a/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-code/highlighted-code.tsx +++ b/src/components/markdown-renderer/replace-components/highlighted-fence/highlighted-code/highlighted-code.tsx @@ -42,7 +42,7 @@ export const HighlightedCode: React.FC = ({ code, language import(/* webpackChunkName: "highlight.js" */ '../../../../common/hljs/hljs').then((hljs) => { const languageSupported = (lang: string) => hljs.default.listLanguages() .includes(lang) - const unreplacedCode = !!language && languageSupported(language) ? hljs.default.highlight(language, code).value : escapeHtml(code) + const unreplacedCode = !!language && languageSupported(language) ? hljs.default.highlight(code, { language }).value : escapeHtml(code) const replacedDom = replaceCode(unreplacedCode) .map((line, index) => (