Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pento opened this issue Nov 8, 2019 · 1 comment
Closed

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

pento opened this issue Nov 8, 2019 · 1 comment
Assignees
Labels
[Feature] Paste [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@pento
Copy link
Member

pento commented Nov 8, 2019

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.

@ellatrix
Copy link
Member

Fixed by #20983.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants