From dbf7b72f9b00a2877615bd048e6da0020b22130a Mon Sep 17 00:00:00 2001 From: Rob Stinogle Date: Thu, 8 Nov 2018 15:33:02 -0700 Subject: [PATCH] Parse the text value in code blocks This resolves an issue where code block child nodes are returning strings only, rather than a TextNode. This causes them to fail to render when imported. --- packages/draft-js-import-markdown/src/MarkdownParser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/draft-js-import-markdown/src/MarkdownParser.js b/packages/draft-js-import-markdown/src/MarkdownParser.js index 92e47a6f..ef46b420 100644 --- a/packages/draft-js-import-markdown/src/MarkdownParser.js +++ b/packages/draft-js-import-markdown/src/MarkdownParser.js @@ -760,7 +760,7 @@ Parser.prototype.tok = function() { ); } case 'code': { - return this.renderer.code(this.token.text, this.token.lang); + return this.renderer.code(this.inline.parse(this.token.text), this.token.lang); } case 'blockquote_start': { let body = new FragmentNode();