Markdown: a second formatting pass removes nested emphasis
Author: torjan0Created Sep 13, 2026Updated Sep 13, 2026
Prettier 3.9.6
--parser markdown
Input:
**a _**b**_ c**
Output:
**a _**b**\_ c**
Expected output:
**a _**b**_ c**
Why?
Prettier itself produces this input when formatting **a ***b*** c**. That first pass preserves CommonMark rendering. Formatting again removes the emphasis on b and introduces literal underscores. Equivalent formatting that preserves the original emphasis is fine.
Also reproduced on development commit 891accaaab6dab0fbb5eba6748fbb1f5ac4809b5. Related #17143 changed delimiter styling; this example still fails in 3.9.6.
GPT-6 Astra assisted; I manually reviewed this report.
Source: prettier/prettier