From 7277080793cd1473dfb6e508adb01f5e0a741db2 Mon Sep 17 00:00:00 2001 From: christopherbiscardi Date: Tue, 16 Apr 2019 12:32:52 -0700 Subject: [PATCH] raw nodes should be labeled as element after conversion `raw` returns the root node type as `root`, which ends up causing double-processing issues. We swapped it to `jsx` to fix that, which ends up causing the converted HAST to get picked off before it can be processed into template strings, etc. The type should be `element` so that downstream processing happens appropriately. --- packages/mdx/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mdx/index.js b/packages/mdx/index.js index d5cdd889b..d6ef0c076 100644 --- a/packages/mdx/index.js +++ b/packages/mdx/index.js @@ -65,7 +65,7 @@ function applyHastPluginsAndCompilers(compiler, options) { compiler.use(() => ast => { visit(ast, 'raw', node => { const {children, tagName, properties} = raw(node) - node.type = 'jsx' + node.type = 'element' node.children = children node.tagName = tagName node.properties = properties