Skip to content

Commit

Permalink
fix: add missing argument for highlighting code
Browse files Browse the repository at this point in the history
  • Loading branch information
smalluban committed Sep 1, 2020
1 parent b480822 commit 028ef2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/render/compiler/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import Prism from 'prismjs';
import 'prismjs/components/prism-markup-templating';

export const highlightCodeCompiler = ({ renderer }) =>
(renderer.code = function(code, lang = '') {
(renderer.code = function(code, lang = 'markup') {
const langOrMarkup = Prism.languages[lang] || Prism.languages.markup;
const text = Prism.highlight(
code.replace(/@DOCSIFY_QM@/g, '`'),
langOrMarkup
langOrMarkup,
lang
);

return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${text}</code></pre>`;
Expand Down

0 comments on commit 028ef2a

Please sign in to comment.