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 issue with empty headings and blockquotes #18

Closed Rosey closed 7 years ago

Rosey commented 7 years ago

As reported here: https://github.com/Rosey/markdown-draft-js/issues/17

DraftJS convertFromRaw expects headings and blockquotes to always have text defined, which was not the case if the markdown string was something like a single # or >.

By defining the text value by default to be an empty string, we get around this issue, and the empty string will under normal circumstances still be replaced by the proper content if there is any.