Skip to content

Commit

Permalink
[fix] Make tsx load properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Apr 25, 2019
1 parent cb8c712 commit cb33742
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/docusaurus-1.x/lib/core/renderMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
const hljs = require('highlight.js');
const Markdown = require('remarkable');
const prismjs = require('prismjs');
const loadLanguages = require('prismjs/components/index');
const deepmerge = require('deepmerge');
const chalk = require('chalk');
const anchors = require('./anchors.js');
Expand Down Expand Up @@ -51,6 +52,7 @@ class MarkdownRenderer {
try {
// Currently people using prismjs on Node have to individually require()
// every single language (https://github.com/PrismJS/prism/issues/593)
loadLanguages([language]);
require(`prismjs/components/prism-${language}.min`);
return prismjs.highlight(str, prismjs.languages[language]);
} catch (err) {
Expand Down

0 comments on commit cb33742

Please sign in to comment.