Skip to content

Block API: pasteHandler() removes iframes too early. #18389

@pento

Description

@pento

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:

  1. Create a new post as an Author user.
  2. Place appropriate breakpoints in pasteHandler(), to observer the state.
  3. Paste an iframe.
  4. 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.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions