mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
fix(v1): fix JSX highlighting by passing language to Prism (#2196)
* Fix JSX highlighting by passing language to Prism * Make Prettier happy * Keep guessing what Prettier wants because CI doesn't tell me
This commit is contained in:
parent
c2aeda273c
commit
632e2dc437
|
|
@ -54,7 +54,11 @@ class MarkdownRenderer {
|
|||
// Currently people using prismjs on Node have to individually require()
|
||||
// every single language (https://github.com/PrismJS/prism/issues/593)
|
||||
loadLanguages([language]);
|
||||
return prismjs.highlight(str, prismjs.languages[language]);
|
||||
return prismjs.highlight(
|
||||
str,
|
||||
prismjs.languages[language],
|
||||
language,
|
||||
);
|
||||
} catch (err) {
|
||||
if (err.code === 'MODULE_NOT_FOUND') {
|
||||
const unsupportedLanguageError = chalk.yellow(
|
||||
|
|
|
|||
Loading…
Reference in New Issue