sstur / draft-js-utils

DraftJS: import/export ContentState to and from HTML/Markdown
ISC License
883 stars 233 forks source link

Use * instead of _ for italics #263

Open Nic0S opened 2 years ago

Nic0S commented 2 years ago

This fixes issues converting text with italics in the middle of the word, for example

aaaaaaitalicbbbb

Or when the space at the end of the word is italicized:

aaaaaitalic bbbb

Or when mixing bold / italic / bold+italic

aaaaitalicbolditalicitalicbbb

I have tested rendering the resulting markdown with both ReactMarkdown (https://github.com/remarkjs/react-markdown) and on iOS with the builtin AttributedString to confirm it renders correctly