Skip to content

Commit 390e5b0

Browse files
ChristopherBiscardijohno
authored andcommitted
raw nodes should be labeled as element after conversion (#533)
`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.
1 parent fffa499 commit 390e5b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/mdx/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function applyHastPluginsAndCompilers(compiler, options) {
6565
compiler.use(() => ast => {
6666
visit(ast, 'raw', node => {
6767
const {children, tagName, properties} = raw(node)
68-
node.type = 'jsx'
68+
node.type = 'element'
6969
node.children = children
7070
node.tagName = tagName
7171
node.properties = properties

0 commit comments

Comments
 (0)