Subject of the issue
As we're trying to improve Prettier's support of MDX, I'm trying to understand its syntax better. So far it looked like block-level JSX is supposed to be 100% React-compatible for it to be possible to copy-paste React code from JS to MDX (also it would allow Prettier to use the same code for formatting JSX that it uses for JSX in JS). But I found an incompatibility that breaks this use case, namely: a line break between an element and text doesn't create whitespace in the output in React but does in MDX. Posting here after asking on Spectrum.
Your environment
The official playground https://mdxjs.com/playground/
Steps to reproduce
Expected behaviour
Should be rendered as
foobar
https://codepen.io/thorn0/pen/NWWEaoo
Actual behaviour
Is rendered as
foo bar
Subject of the issue
As we're trying to improve Prettier's support of MDX, I'm trying to understand its syntax better. So far it looked like block-level JSX is supposed to be 100% React-compatible for it to be possible to copy-paste React code from JS to MDX (also it would allow Prettier to use the same code for formatting JSX that it uses for JSX in JS). But I found an incompatibility that breaks this use case, namely: a line break between an element and text doesn't create whitespace in the output in React but does in MDX. Posting here after asking on Spectrum.
Your environment
The official playground https://mdxjs.com/playground/
Steps to reproduce
Expected behaviour
Should be rendered as
https://codepen.io/thorn0/pen/NWWEaoo
Actual behaviour
Is rendered as