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

Quirk in handling of mixed bold and italics in a single word #128

Open
cabiad opened this issue Jul 6, 2020 · 1 comment
Open

Quirk in handling of mixed bold and italics in a single word #128

cabiad opened this issue Jul 6, 2020 · 1 comment

Comments

@cabiad
Copy link
Contributor

cabiad commented Jul 6, 2020

First up, I just wanted to say thanks for this project and especially for making the interactive demo of it so easily available. It looks like it's going to be a big help for me. It seems to have much better support for escaping markdown special characters than some alternatives I've also tried, which sets it apart. Also, thanks for setting expectations on turnaround for any discussion or a fix. I know that these are highly unusual times and would not ever want to cause any distress by this, so please only respond if or when you feel able to do so comfortably.

That said, I was playing around with the interactive tool and noticed a seemingly small quirk in the way bold and italics are handled that I can reproduce reliably:

  1. In the draftjs editor, type the single word "boldbothitalics" (it doesn't matter what you type, but this is demonstrative)
  2. Highlight the 'bothitalics' portion, and apply italics using the draft editor's button
  3. Highlight the 'boldboth' portion, and apply bold using the draft editor's button
  4. Note that the markdown produced is: **bold_both_**_italics_

image

  1. Add a space to the end of the markdown, presumably triggering an import back into the draftjs editor component
  2. Note that the formatting in the draftjs editor has been corrupted:

image

Manually entering the following markdown seems to generate the correct formatting in the draftjs editor however: __bold__***both***_italics_

image

I'm not sure if this is a hard fix or an easy one, but I thought I'd record it here since I found a good way to reproduce.

(As a side note, I'll also mention that GitHub themselves seem to have a very similar issue generating correct markdown for this formatting. That suggests this might be a tough problem. If you use the formatting buttons in the GitHub editor to create boldbothitalics, you end up with the following markdown: **bold_both**italics_ which renders as bold_bothitalics_.)

@Rosey
Copy link
Owner

Rosey commented Jul 6, 2020

Nice, thank you for the detailed report and kind words! I'll take a look when I have a chance, seems worth investigating ♥️

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

2 participants