Skip to content

Commit

Permalink
fix: add missing argument for highlighting code (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
smalluban authored Sep 1, 2020
1 parent b480822 commit f35bf99
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

1 comment on commit f35bf99

@vercel
Copy link

@vercel vercel bot commented on f35bf99 Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.