Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Change Prism implementation to include classes
Browse files Browse the repository at this point in the history
In the old example, Prism will return the `<code></code>` blocks correctly, but it won't style the external `<pre></pre>` blocks, which is what defines the background of the code section.

This update means Prism will now have the correct `<pre><code></code></pre>` setup with all the classes in place, so you get the background of your theme too.
  • Loading branch information
calebanthony authored Oct 4, 2017
1 parent 56e04d7 commit 4dad625
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/content/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ module.exports = {
parsers: {
md: {
highlight: (code, lang) => {
return Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)
return `<pre class="language-${lang}"><code class="language-${lang}">${Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)}</code></pre>`
}
}
}
Expand Down

0 comments on commit 4dad625

Please sign in to comment.