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
Outputs incorrect markdown #10
Comments
Thanks for reporting this @Jpunt , I will try to fix this soon. |
hi @jpuri is there any plan to fix this? |
Having this issue as well and it's not an issue with this library, but something that is carried from react-draft-wysiwyg. Let me explain (following the same example as OP)
As it can be seen from Since this issue is 4 years old, I thought about patching the diff. But the issue is that copy-pasting the text (which leaves it unstyled) and then applying style to the Which is now correct and substracting the lenght would apply bold style to only a substring of the word. Edit: on top of this, combining styles with emojis will break it even further and emojis will appear as � icons (might be related to this |
#43 as a workaround, to make it work directly from this library. It's based in two proposals:
This fix is applied to https://www.npmjs.com/package/@nhevia/draftjs-to-markdown because I need this fix ASAP and they don't look like moving a lot. But if PR is merged I'll go back to this lib. |
Let's assume a user starts typing, enables bold, types some more words (and ends with a space).
As soon as the user disabled bold, this results in invalid markdown:
The space after the word
bold
should be placed after the two stars instead of before them, or it'll result in a plain text (containing the stars themselves).Edit: This issue also happens a lot sooner:
This will result in
**word **
, instead of the word in bold.The text was updated successfully, but these errors were encountered: