diff --git a/docs/src/modules/components/MarkdownElement.js b/docs/src/modules/components/MarkdownElement.js index 598bef4760bd36..a7d6b409005308 100644 --- a/docs/src/modules/components/MarkdownElement.js +++ b/docs/src/modules/components/MarkdownElement.js @@ -99,15 +99,11 @@ const markedOptions = { break; } - if (!prismLanguage && language) { + if (!prismLanguage) { throw new Error(`unsuppored language: "${language}", "${code}"`); } - if (prismLanguage) { - return prism.highlight(code, prismLanguage); - } - - return code; + return prism.highlight(code, prismLanguage); }, renderer, }; @@ -141,7 +137,7 @@ const styles = theme => ({ fontSize: 14, borderRadius: 2, }, - '& pre > code': { + '& code[class*="language-"]': { backgroundColor: '#333', color: '#fff', }, diff --git a/docs/src/pages/guides/minimizing-bundle-size/minimizing-bundle-size.md b/docs/src/pages/guides/minimizing-bundle-size/minimizing-bundle-size.md index 87e88dfad7e8b1..07c47c643465ad 100644 --- a/docs/src/pages/guides/minimizing-bundle-size/minimizing-bundle-size.md +++ b/docs/src/pages/guides/minimizing-bundle-size/minimizing-bundle-size.md @@ -175,7 +175,7 @@ If you are using Create React App, you will need to use a couple of projects tha Note: You may run into errors like these: - ``` + ```sh Module not found: Can't resolve '@material-ui/core/makeStyles' in '/your/project' Module not found: Can't resolve '@material-ui/core/createStyles' in '/your/project' ```