-
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
Revert: Fix unable to remove empty blocks on merge (#65262) + alternative #66564
Revert: Fix unable to remove empty blocks on merge (#65262) + alternative #66564
Conversation
Size Change: -111 B (-0.01%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
This tests well for me and I like the usage of block's category. Thank you!
Thank you Nik! |
…+ alternative (WordPress#66564) Co-authored-by: ellatrix <[email protected]> Co-authored-by: ntsekouras <[email protected]> Co-authored-by: kspilarski <[email protected]> Co-authored-by: talldan <[email protected]> Co-authored-by: ndiego <[email protected]> Co-authored-by: kevin940726 <[email protected]> Co-authored-by: richtabor <[email protected]>
@@ -47,8 +47,6 @@ import { PrivateBlockContext } from './private-block-context'; | |||
|
|||
import { unlock } from '../../lock-unlock'; | |||
|
|||
const { isUnmodifiedBlockContent } = unlock( blocksPrivateApis ); |
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.
Nice to see that we have one less private API now 👍
What?
In #45075, I added a writing flow behaviour that would unwrap the first paragraph or heading inside a list, quote or group block. #65174 suggests that this behaviour is a bit too much for group blocks. It seems the boundary around group blocks needs to be a little stronger (it's always hard to strike a good balance). The solution would be to exclude the group block from this behaviour. This can easily be done by restricting the behaviour to blocks within the
text
category block (includes quote and list, but excludes group). I have made this change in 9d5dde4.#65262 took an alternative, much more complex, approach. It basically checks if the content of the block to be moved/merged/deleted is empty, but applies this behaviour also to quote blocks. Another issue is that non-empty blocks will still be moved. The added complexity is also significant, so I opted to revert it in c432469.
Closes #65174.
Why?
See #65174 and the explanation above.
How?
See above, let's exclude non textual blocks from this behaviour.
Testing Instructions
Now to the following for list and quote
Additionally, this provides a generalised solution for removing an aligned paragraph. Test the following content:
In trunk, backspace from this paragraph will not do anything. With this PR, it will remove the alignment.
Testing Instructions for Keyboard
Screenshots or screencast