Skip to content

Commit

Permalink
Fix CSS for code block without language
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsmfm committed Oct 27, 2019
1 parent 422a5d5 commit 6285109
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/src/modules/components/MarkdownElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ const markedOptions = {
break;
}

if (!prismLanguage) {
if (language) {
throw new Error(`unsuppored language: "${language}", "${code}"`);
} else {
prismLanguage = prism.languages.jsx;
}
if (!prismLanguage && language) {
throw new Error(`unsuppored language: "${language}", "${code}"`);
}

if (prismLanguage) {
return prism.highlight(code, prismLanguage);
}

return prism.highlight(code, prismLanguage);
return code;
},
renderer,
};
Expand Down Expand Up @@ -141,7 +141,7 @@ const styles = theme => ({
fontSize: 14,
borderRadius: 2,
},
'& code[class*="language-"]': {
'& pre > code': {
backgroundColor: '#333',
color: '#fff',
},
Expand Down

0 comments on commit 6285109

Please sign in to comment.