You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you so much for sharing this plugin!
An error occurs when a markdown line is converted to DraftJS with one or multiple # symbols that is not followed by regular characters. A header block is created, but since it does not have a text attribute, it's length cannot be calculated.
Uncaught TypeError: Cannot read property 'length' of undefined
at decodeInlineStyleRanges (webpack:///./~/draft-js/lib/decodeInlineStyleRanges.js?:30:26)
at eval (webpack:///./~/draft-js/lib/convertFromRawToDraftState.js?:66:24)
at Array.map (native)
at Object.convertFromRawToDraftState [as convertFromRaw] (webpack:///./~/draft-js/lib/convertFromRawToDraftState.js?:50:30)
at createDraftFromMarkdown (webpack:///./app/helpers/markdownHelper.js?:20:76)
at reducer (webpack:///./app/state/markdownEditor/reducer.js?:50:106)
at eval (webpack:///./~/redux-immutable/dist/combineReducers.js?:37:31)
at Array.forEach (native)
at eval (webpack:///./~/redux-immutable/dist/combineReducers.js?:34:19)
at Map.withMutations (webpack:///./~/immutable/dist/immutable.js?:1355:7)
Darn sorry for such a long delay in my reply, I somehow missed the notification of this issue being opened and so I didn't even know there was anything to respond to until I was randomly viewing the repo this morning! Two months later 😳
As reported here: #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.
First of all, thank you so much for sharing this plugin!
An error occurs when a markdown line is converted to DraftJS with one or multiple
#
symbols that is not followed by regular characters. A header block is created, but since it does not have atext
attribute, it's length cannot be calculated.The bug can be replicated like this
If we take the constructed object, and add a
text
attribute string to the header block, there are no errors.Perhaps the header block should contain an empty string as its
text
attribute.The text was updated successfully, but these errors were encountered: