Skip to content

Commit

Permalink
fix(markdown): null check for code.lang (#4307)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatyang committed Apr 13, 2018
1 parent 47cb5ad commit c814a9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/language-markdown/embed.js
Expand Up @@ -12,7 +12,7 @@ const markAsRoot = docBuilders.markAsRoot;
function embed(path, print, textToDoc, options) {
const node = path.getValue();

if (node.type === "code") {
if (node.type === "code" && node.lang !== null) {
// only look for the first string so as to support [markdown-preview-enhanced](https://shd101wyy.github.io/markdown-preview-enhanced/#/code-chunk)
const lang = node.lang.split(/\s/, 1)[0];
const parser = getParserName(lang);
Expand Down

0 comments on commit c814a9f

Please sign in to comment.