Describe the bug
It's possible to register a block with a raw transform that converts an iframe to a block. This works as expected when transforming a Classic block into blocks.
However, when pasting a matching iframe into the block editor, pasteHandler() will run the iframeRemover filter before htmlToBlocks() is run, so the block transform isn't run.
To reproduce
Steps to reproduce the behavior:
- Create a new post as an Author user.
- Place appropriate breakpoints in
pasteHandler(), to observer the state.
- Paste an iframe.
- Observe that the iframe has been removed from
piece before it is passed to htmlToBlocks().
Expected behavior
The iframe is passed to htmlToBlocks(), so the block transform can handle it.
Describe the bug
It's possible to register a block with a
rawtransform that converts an iframe to a block. This works as expected when transforming a Classic block into blocks.However, when pasting a matching iframe into the block editor,
pasteHandler()will run theiframeRemoverfilter beforehtmlToBlocks()is run, so the block transform isn't run.To reproduce
Steps to reproduce the behavior:
pasteHandler(), to observer the state.piecebefore it is passed tohtmlToBlocks().Expected behavior
The iframe is passed to
htmlToBlocks(), so the block transform can handle it.