Skip to content

Commit 3b51c93

Browse files
committed
add comment about mdx v3 support in prettier
1 parent 815a636 commit 3b51c93

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.prettierrc.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ export default {
1414
parser: "astro",
1515
},
1616
},
17+
// Prettier's MDX formatter wraps inline JSX elements (like <code> and
18+
// <GlossaryTooltip>) onto new lines, which causes MDX v2+ to inject <p>
19+
// tags inside them — breaking the rendered HTML. This custom plugin
20+
// prevents that by keeping configured elements on a single line.
21+
// This may become unnecessary once prettier adds MDX v3 support:
22+
// https://github.com/prettier/prettier/issues/12209
1723
{
1824
files: "*.mdx",
1925
options: {

0 commit comments

Comments
 (0)