Rosey / markdown-draft-js

A tool to convert content created in DraftJS to markdown and vice versa.
https://rosey.github.io/markdown-draft-js/
MIT License
318 stars 70 forks source link

Fix nested inline styles not being correctly closed/reopened #3

Closed Rosey closed 7 years ago

Rosey commented 7 years ago

Example of something that would fail:

bold text with italic inside that continues after bold doesn't

This should be rendered as:

**bold text _with italic inside_** _that continues after bold doesn't_

But instead is being rendered as

**bold text _with italic inside** that continues after bold doesn't_

This change keeps track of currently open inline styles and close/reopens them before and after a parent style is closed. GH issue: https://github.com/Rosey/markdown-draft-js/issues/2