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.
As reported here: https://github.com/Rosey/markdown-draft-js/issues/17
DraftJS
convertFromRaw
expects headings and blockquotes to always havetext
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.