prettier
prettier copied to clipboard
Markdown: munges github emoji strings when along-side italics
trafficstars
Prettier 2.3.2 Playground link
--parser markdown
Input:
:stop_sign: ***(new)***
:stop_sign: **_(new)_**
Output:
:stop*sign: ***(new)***
:stop_sign: \*\**(new)\_\*\*
Expected behavior:
:stop_sign: **_(new)_**
:stop_sign: **_(new)_**
Prettier assumes that the _ in the emoji string is an italic marker, so then it does some weird stuff with it.
I can confirm this as well:
[:point_up_2: _credits_](https://stackoverflow.com/a/65831302/2310634)
Same on my side
:japanese_goblin: *Fasnachtsferien*
is "corrected" to
:japanese_goblin: _Fasnachtsferien_
which kills the emoji 😢
@codingluke convering * to _ for italics is expected behavior. The same applies to __ converting to ** for bold.
Prettier 2.8.4 Playground link
--parser markdown
Input:
*italics*
_italics_
**bold**
__bold__
:japanese_goblin: *Fasnachtsferien*
Output:
_italics_
_italics_
**bold**
**bold**
:japanese_goblin: _Fasnachtsferien_
This still is an issue in v2.8.8 for emoji that have more than one underscore:
Input:
:hammer_and_wrench: That emoji has _multiple underscores_ in it and causes problems.
Output:
:hammer_and_wrench: That emoji has \_multiple underscores* in it and causes problems.