-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Pasting content that results in a new block shouldn't be treated as inline content. #19084
Conversation
Could some sort of test be added? |
The new I've added some tests, too. |
docs/designers-developers/developers/block-api/block-registration.md
Outdated
Show resolved
Hide resolved
@pento I marked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, this makes sense! :)
Description
When pasting text, the paste handler currently assumes that if the text doesn't have a line break, and it results in one block, it can be treated as inline text, instead.
This may be correct for core, but is not necessarily correct for plugins that may wish to transform a single line of text into a custom block.
This PR tightens the paste handler assumption to only allow a selection of blocks to be treated as an inline paste.
Fixes #18390.
How has this been tested?
Tested with the sample plugin in #18390.
Checklist: