Closed tonywu6 closed 1 year ago
mdast-util-mdx-jsx@2.1.3, remark-mdx@2.3.0, remark-parse@10.0.2, remark-stringify@10.0.3
https://codesandbox.io/p/sandbox/nostalgic-cloud-fdvyzk
Maybe introduced here?
https://github.com/syntax-tree/mdast-util-mdx-jsx/blob/10a502c81764206f031edd71d9799a4da7e3f3d2/lib/index.js#L529
With default options, parse and then stringify a MDX document containing a mdxJsxTextElement nested inside a mdxJsxFlowElement, for example:
mdxJsxTextElement
mdxJsxFlowElement
<div> Lorem ipsum <span>dolor</span> sit amet </div>
Input and output should be the same
Inline elements have extra whitespace in front of them
node@16.20
pnpm@8.5.0
macOS Ventura 13.1
No response
inferDepth only handles flow elements, not texts: https://github.com/syntax-tree/mdast-util-mdx-jsx/blob/10a502c81764206f031edd71d9799a4da7e3f3d2/lib/index.js#L732.
inferDepth
Can repro in this project, thanks!
Thanks for the report, released!
Initial checklist
Affected packages and versions
mdast-util-mdx-jsx@2.1.3, remark-mdx@2.3.0, remark-parse@10.0.2, remark-stringify@10.0.3
Link to runnable example
https://codesandbox.io/p/sandbox/nostalgic-cloud-fdvyzk
Steps to reproduce
Maybe introduced here?
https://github.com/syntax-tree/mdast-util-mdx-jsx/blob/10a502c81764206f031edd71d9799a4da7e3f3d2/lib/index.js#L529
With default options, parse and then stringify a MDX document containing a
mdxJsxTextElement
nested inside amdxJsxFlowElement
, for example:Expected behavior
Input and output should be the same
Actual behavior
Inline elements have extra whitespace in front of them
Affected runtime and version
node@16.20
Affected package manager and version
pnpm@8.5.0
Affected OS and version
macOS Ventura 13.1
Build and bundle tools
No response