Open tetracalibers opened 3 weeks ago
Prettier supports MDX v1. You have to write instead:
<div className="note">
> Some notable things in a block quote!
</div>
If you don't insert the two blank lines, the content of div
is interpreted as a raw JSX, not Markdown.
See: #12209 #15221
Prettier 3.3.3 Playground link
Input:
Output:
When placing long text within JSX tags, the
--prose-wrap preserve
option does not work as expected, resulting in unintended line breaks. This issue can be avoided by inserting a blank line before and/or after the text inside the JSX tags.Expected output:
Why?
As per my understanding of MDX syntax, it is not necessary to insert blank lines between tags and the Markdown inside them. For example, the MDX documentation provides the following example, which renders correctly:
I think it would be preferable for the text inside tags to follow the Markdown formatting rules (based on the
--prose-wrap
setting) even when no blank lines are inserted.