Filters should inject blocks before and after atomic
blocks as required
#14
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Milestone
Feature (to address a bug in Draft.js). See facebookarchive/draft-js#523 (comment) and facebookarchive/draft-js#1082.
What is the current behavior?
This also happens for other block types than unstyled – all that's needed is for the blocks to be empty.
What is the expected behavior?
Blocks should be preserved. The filters can't preserve the right block type (would require a fix in Draft.js), but they could at least inject
unstyled
blocks where appropriate. There are three cases I know of:For the implementation, I think this should probably go after
removeInvalidAtomicBlocks
infilterEditorState
, so it only happens where really necessary.I imagine the implementation would need to reduce through the blocks, inserting new ones where appropriate. This probably needs to happen for
atomic
blocks rather than just images, but AFAIK only images are preserved on copy-paste anyway, at least for now.The text was updated successfully, but these errors were encountered: