Skip to content

Commit

Permalink
Optimize Prism.js (#368)
Browse files Browse the repository at this point in the history
Optimize Prism.js
  • Loading branch information
marvinhagemeister authored Aug 2, 2019
2 parents 65c0c78 + 3d3a293 commit d6f7eb0
Show file tree
Hide file tree
Showing 2 changed files with 544 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/code-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CodeBlock = ({ children, ...props }) => {
child.props.class &&
child.props.class.match(/(?:lang|language)-([a-z]+)/)[1];

const canHighlight = !PRERENDER && prism.languages[lang] != null;
const canHighlight = prism.languages[lang] != null;

let highlighted = canHighlight
? prism.highlight(text, prism.languages[lang], lang)
Expand Down
Loading

0 comments on commit d6f7eb0

Please sign in to comment.