-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Raw handling: fix block schema merging #56558
Conversation
Size Change: +562 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
'<pre class="wp-block-preformatted">1\n2</pre>' | ||
); | ||
expect( console ).toHaveLogged(); | ||
} ); |
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.
The above test will fail in trunk.
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 fixing it and for adding integration tests, @ellatrix 🙌
I confirm that the pre
test fails in trunk, but passes here 👍
I also appreciate the readability your merging suggestion introduces - makes it much more predictable for someone who isn't aware of the existing schemas. 💯
Finally, so much cleaner than using a deep merging library that was not only not working in all cases but also likely to have been adding overhead. 🏋️
Should this be cherry-picked to a minor release? 🍒
In any case, 🚀 and thanks again!
// An tagName schema is an object with children, attributes, require, and | ||
// isMatch properties. |
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.
// An tagName schema is an object with children, attributes, require, and | |
// isMatch properties. | |
// A tagName schema is an object with children, attributes, require, and | |
// isMatch properties. |
What?
#50637 introduced a problem with schema merging. It seems the
isMatch
functions are not properly merged. For some reason the custom merge function is not working, while it was working with the lodash function.How?
Just merge it ourselves.
Testing Instructions
Go to https://www.gutenberg.org/cache/epub/11/pg11.txt, select a few paragraphs, and paste it into GB. Instead of a Preformatted block, it's a paragraph with one giant text block.
Testing Instructions for Keyboard
Screenshots or screencast