Skip to content

Commit

Permalink
[docs] Fail if missing language
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 29, 2019
1 parent 6285109 commit ca46276
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions docs/src/modules/components/MarkdownElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -141,7 +137,7 @@ const styles = theme => ({
fontSize: 14,
borderRadius: 2,
},
'& pre > code': {
'& code[class*="language-"]': {
backgroundColor: '#333',
color: '#fff',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```
Expand Down

0 comments on commit ca46276

Please sign in to comment.