prettier icon indicating copy to clipboard operation
prettier copied to clipboard

Markdown: munges github emoji strings when along-side italics

Open bradzacher opened this issue 4 years ago • 4 comments
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.

bradzacher avatar Aug 16 '21 16:08 bradzacher

I can confirm this as well:

[:point_up_2: _credits_](https://stackoverflow.com/a/65831302/2310634)

myknbani avatar May 13 '22 17:05 myknbani

Same on my side

:japanese_goblin: *Fasnachtsferien*

is "corrected" to

:japanese_goblin: _Fasnachtsferien_

which kills the emoji 😢

codingluke avatar Mar 16 '23 09:03 codingluke

@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_

kachkaev avatar Mar 16 '23 09:03 kachkaev

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.

tillig avatar Jun 30 '23 15:06 tillig