jpuri / draftjs-to-html

Library for converting Draftjs editor content state to HTML
MIT License
321 stars 143 forks source link

End of content is excluded from most recent changes #23

Open CamWalker opened 7 years ago

CamWalker commented 7 years ago

Thank you @jpuri for all your work here.

In using your editor and changing to html, I noticed that part of the stylings is not being applied to all the content. I even tried it in storybook mode and was able to reproduce the error.

It appears that when an emoji is inserted, it will leave off the final character from the applied stylings.

For example:

🤔 What's wrong with lines with emojis? becomes <p>🤔 What's wrong with lines with<strong> emojis</strong>?</p>

The question mark was excluded from the bold styling

and 😁😀 double trouble becomes <p><strong>😁😀 double troub</strong>le</p>

jpuri commented 7 years ago

Some unicodes take 2 characters and are creating trouble. Its going busier for me but I will try to check this soon.