Rosey/markdown-draft-js

mid-word inline italics

Closed this issue · 3 comments

If I type into the draft editor: abcXYZabc where XYZ is italic , it will render the markdown as abc_XYZ_abc (this is fine). When that gets converted back into DraftJS, the text is rendered as abc_XYZ_abc.

Rosey commented

Yeah this is sort of a... hm. I've noticed this before and I'm not sure what the best way to fix it is. It seems markdown doesn't work like that, eg if I type this in here on github: abc_XYZ_abc it won't be italicized. There has to be a space before the _ symbol for it to get picked up. But by inserting a space when converting from draft to markdown, we are changing the content which may also not be desired.

So it seems the options are:

  1. Insert space, which might be bad
  2. Don't italicize in this case, which sadly will also confuse people 😢
Rosey commented

Tentatively labeling as a wontfix pending further discussion on the best course of action 😄

According to CommonMark, the only valid way to provide intraword emphasis is using *'s, but there are a number of rules that make it less than simple to provide proper two-way conversion (whitespace or punctuation mess with these things).