Closed mbm-michal closed 4 years ago
Hi @mbm-michal , why you close this PR? it seems an interesting solution , did it work for you ?
there is also another solution mentioned in the link you've provided that's mentions the customRenderMap
import { Map } from 'immutable';
import Editor from 'draft-js';
const customRenderMap = Map({
unstyled: {
element: 'div',
// will be used in convertFromHTMLtoContentBlocks
aliasedElements: ['p'],
},
});
<Editor
editorState={this.state.editorState}
blockRenderMap={customRenderMap}
/>
so , maybe the solution could be extend the unstyled
in https://github.com/michelson/dante2/blob/master/src/editor/components/core/editor.js#L47
When copy pasting from word it was connecting multiple paragraphs into 1 block. I've noticed that solution was already applied: https://stackoverflow.com/questions/39047832/draft-js-how-to-preserve-paragraph-breaks-when-pasting-content?rq=1