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 8d3069e
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}"`);
}

return prism.highlight(code, prismLanguage);
if (prismLanguage) {
return prism.highlight(code, prismLanguage);
} else {
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 8d3069e

Please sign in to comment.