micromark / micromark-extension-mdx-jsx

micromark extension to support MDX or MDX.js JSX
https://unifiedjs.com
MIT License
8 stars 4 forks source link

Confusion in jsx tags with properties containing a colon alongside spread attributes #1

Closed ChristianMurphy closed 3 years ago

ChristianMurphy commented 3 years ago

Subject of the issue

Confusion in jsx tags with properties containing a colon alongside spread attributes.

<x y:z {...a} />

https://astexplorer.net/#/gist/4617b3d1f2459fceefc94caa748512d0/548cfbc344430bc9ed21a4cd94825eaddb063686

Your environment

Steps to reproduce

const micromark = require("micromark/lib");
const mdx = require("micromark-extension-mdx");

console.log(micromark("<x y:z {...a} />", "utf-8", { extensions: [mdx()] }));

Expected behavior

Content should be parsed

Actual behavior

AssertionError [ERR_ASSERTION]: expected exit token to match current token
 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: 'mdxJsxTextTagAttribute',
  expected: 'mdxJsxFlowTagAttribute',
  operator: '=='
}
wooorm commented 3 years ago

Whoops, typo