Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown doesn't support italic in the middle of words #179

Open
SamiSaves opened this issue Apr 29, 2019 · 6 comments
Open

Markdown doesn't support italic in the middle of words #179

SamiSaves opened this issue Apr 29, 2019 · 6 comments

Comments

@SamiSaves
Copy link

Currently it is impossible to use italic in the middle of words, because the import plugin will render underscores in the middle of words as underscores instead of turning them into italic (As it should, see commonmark specs and github specs).

For example exporting "testitalicword" and then importing it back would result in test_italic_word.

Possible fix

I tried fixing it by changing the italic from underscore to asterisk inthe draft-js-export-markdown plugin and for me it seemed to fix the issue.

In source

@sstur
Copy link
Owner

sstur commented Apr 29, 2019

OK. I'd be open to a PR to use asterisk, but it's a breaking change so perhaps only do it when necessary to disambiguate an italic within a word. Other ideas to minimize breakage?

@SamiSaves
Copy link
Author

Yeah it probably needs to be considered as a breaking change if someone trusts the plugin to generate underscores, but I doubt it will cause much breakage. Markdown should consider the asterisk and the underscore nearly identical, and the import plugin will work fine with both.

@krystofbe
Copy link

krystofbe commented Sep 15, 2019

Just stumbled over this, any progress on this? Would you accept a PR changing the italic from underscore to asterisk in the draft-js-export-markdown ?

@sstur
Copy link
Owner

sstur commented Sep 15, 2019

Yea, totally hit me with a PR. Would be happy to review!

[Edit] Both underscore and italics should work for italic in Markdown. If in doubt, do check how GH does it and let's try to mimic that behavior.

@fedeciancaglini
Copy link

Any update on this? I'm having the same issue.

@SamiSaves
Copy link
Author

We decided to fork the repository and apply the fix in this pr manually #182

I never got any comments on PR so I never tried to fix the tests or tried to finalize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants