-
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
Fix allowed patterns check #32376
Fix allowed patterns check #32376
Conversation
Size Change: +317 B (0%) Total Size: 1.03 MB
ℹ️ View Unchanged
|
💯 This also fixes some (5) of the remote patterns, like Quote - any remote pattern that doesn't have a single parent block, I think. So on trunk, the Quote pattern doesn't load, but on this branch it does. |
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 PR solves the issue for me, thank you.
Co-authored-by: ntsekouras <ntsekouras@outlook.com>
Co-authored-by: ntsekouras <ntsekouras@outlook.com>
This includes the following fixes: Widgets Editor: - Load widgets.php WordPress/gutenberg#32299 - Fix Legacy Widget Preview WordPress/gutenberg#32300 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359 Widget blocks in the customizer: - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361 - Display wide widgets as popovers WordPress/gutenberg#31736 Global Styles: - Align classNames generation between client and server WordPress/gutenberg#32352 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404 Template Editor: - Update the appearance of the template details WordPress/gutenberg#32042 - Fix layout definition WordPress/gutenberg#32425 - Fix grouping post content block WordPress/gutenberg#32453 Miscellaneous: - Prevent saving when the post is locked WordPress/gutenberg#32341 - Fix allowed block patterns selector WordPress/gutenberg#32376 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344 - Fix notices position in top toolbar mode WordPress/gutenberg#32238 - Allow non-latin characters in post slugs WordPress/gutenberg#32232 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370 - Fix block alignment styles in the editor WordPress/gutenberg#32454 - Fix some block toolbar overlaps WordPress/gutenberg#32424 - Fix content loss when switching list types WordPress/gutenberg#32432 Performance: - Improve the performance of buttons block WordPress/gutenberg#32356 - Improve the performance of the container blocks WordPress/gutenberg#32380 Props noisysocks, nosolosw, jorgefilipecosta. See #52991. git-svn-id: https://develop.svn.wordpress.org/trunk@51089 602fd350-edb4-49c9-b593-d223f7449a82
This includes the following fixes: Widgets Editor: - Load widgets.php WordPress/gutenberg#32299 - Fix Legacy Widget Preview WordPress/gutenberg#32300 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359 Widget blocks in the customizer: - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361 - Display wide widgets as popovers WordPress/gutenberg#31736 Global Styles: - Align classNames generation between client and server WordPress/gutenberg#32352 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404 Template Editor: - Update the appearance of the template details WordPress/gutenberg#32042 - Fix layout definition WordPress/gutenberg#32425 - Fix grouping post content block WordPress/gutenberg#32453 Miscellaneous: - Prevent saving when the post is locked WordPress/gutenberg#32341 - Fix allowed block patterns selector WordPress/gutenberg#32376 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344 - Fix notices position in top toolbar mode WordPress/gutenberg#32238 - Allow non-latin characters in post slugs WordPress/gutenberg#32232 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370 - Fix block alignment styles in the editor WordPress/gutenberg#32454 - Fix some block toolbar overlaps WordPress/gutenberg#32424 - Fix content loss when switching list types WordPress/gutenberg#32432 Performance: - Improve the performance of buttons block WordPress/gutenberg#32356 - Improve the performance of the container blocks WordPress/gutenberg#32380 Props noisysocks, nosolosw, jorgefilipecosta. See #52991. git-svn-id: https://develop.svn.wordpress.org/trunk@51089 602fd350-edb4-49c9-b593-d223f7449a82
This includes the following fixes: Widgets Editor: - Load widgets.php WordPress/gutenberg#32299 - Fix Legacy Widget Preview WordPress/gutenberg#32300 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359 Widget blocks in the customizer: - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361 - Display wide widgets as popovers WordPress/gutenberg#31736 Global Styles: - Align classNames generation between client and server WordPress/gutenberg#32352 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404 Template Editor: - Update the appearance of the template details WordPress/gutenberg#32042 - Fix layout definition WordPress/gutenberg#32425 - Fix grouping post content block WordPress/gutenberg#32453 Miscellaneous: - Prevent saving when the post is locked WordPress/gutenberg#32341 - Fix allowed block patterns selector WordPress/gutenberg#32376 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344 - Fix notices position in top toolbar mode WordPress/gutenberg#32238 - Allow non-latin characters in post slugs WordPress/gutenberg#32232 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370 - Fix block alignment styles in the editor WordPress/gutenberg#32454 - Fix some block toolbar overlaps WordPress/gutenberg#32424 - Fix content loss when switching list types WordPress/gutenberg#32432 Performance: - Improve the performance of buttons block WordPress/gutenberg#32356 - Improve the performance of the container blocks WordPress/gutenberg#32380 Props noisysocks, nosolosw, jorgefilipecosta. See #52991. Built from https://develop.svn.wordpress.org/trunk@51089 git-svn-id: http://core.svn.wordpress.org/trunk@50698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This includes the following fixes: Widgets Editor: - Load widgets.php WordPress/gutenberg#32299 - Fix Legacy Widget Preview WordPress/gutenberg#32300 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359 Widget blocks in the customizer: - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361 - Display wide widgets as popovers WordPress/gutenberg#31736 Global Styles: - Align classNames generation between client and server WordPress/gutenberg#32352 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404 Template Editor: - Update the appearance of the template details WordPress/gutenberg#32042 - Fix layout definition WordPress/gutenberg#32425 - Fix grouping post content block WordPress/gutenberg#32453 Miscellaneous: - Prevent saving when the post is locked WordPress/gutenberg#32341 - Fix allowed block patterns selector WordPress/gutenberg#32376 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344 - Fix notices position in top toolbar mode WordPress/gutenberg#32238 - Allow non-latin characters in post slugs WordPress/gutenberg#32232 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370 - Fix block alignment styles in the editor WordPress/gutenberg#32454 - Fix some block toolbar overlaps WordPress/gutenberg#32424 - Fix content loss when switching list types WordPress/gutenberg#32432 Performance: - Improve the performance of buttons block WordPress/gutenberg#32356 - Improve the performance of the container blocks WordPress/gutenberg#32380 Props noisysocks, nosolosw, jorgefilipecosta. See #52991. Built from https://develop.svn.wordpress.org/trunk@51089 git-svn-id: https://core.svn.wordpress.org/trunk@50698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This includes the following fixes: Widgets Editor: - Load widgets.php WordPress/gutenberg#32299 - Fix Legacy Widget Preview WordPress/gutenberg#32300 - Fix error when saving empty Legacy Widget block WordPress/gutenberg#32359 Widget blocks in the customizer: - Fix deselection blocks when the inspector is open WordPress/gutenberg#32361 - Display wide widgets as popovers WordPress/gutenberg#31736 Global Styles: - Align classNames generation between client and server WordPress/gutenberg#32352 - Group typography block supports WordPress/gutenberg#32252 WordPress/gutenberg#32444 WordPress/gutenberg#32459 - Make theme.json syntax errors more visible to the users WordPress/gutenberg#32404 Template Editor: - Update the appearance of the template details WordPress/gutenberg#32042 - Fix layout definition WordPress/gutenberg#32425 - Fix grouping post content block WordPress/gutenberg#32453 Miscellaneous: - Prevent saving when the post is locked WordPress/gutenberg#32341 - Fix allowed block patterns selector WordPress/gutenberg#32376 - Fix wrong results in the Post Author picker WordPress/gutenberg#32344 - Fix notices position in top toolbar mode WordPress/gutenberg#32238 - Allow non-latin characters in post slugs WordPress/gutenberg#32232 - Fix Random collapse of the color settings panel WordPress/gutenberg#32388 - Fix theme logo theme mode not being removed on theme removal WordPress/gutenberg#32370 - Fix block alignment styles in the editor WordPress/gutenberg#32454 - Fix some block toolbar overlaps WordPress/gutenberg#32424 - Fix content loss when switching list types WordPress/gutenberg#32432 Performance: - Improve the performance of buttons block WordPress/gutenberg#32356 - Improve the performance of the container blocks WordPress/gutenberg#32380 Props noisysocks, nosolosw, jorgefilipecosta. See #52991. Built from https://develop.svn.wordpress.org/trunk@51089 git-svn-id: http://core.svn.wordpress.org/trunk@50698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@youknowriad I don't get what the issue was in #32376... it was whitespace? How is that related to grammar vs full parse? |
It would be good to have an e2e test. |
Yeah, sorry should have added an e2e test but I guess the testing instructions can be tried again. I don't recall entirely but I think what happened with the example is that you end up with an "empty" block type which was considered "not allowed" or something like that. But it's also not the only issue that can happen. For instance if you use |
closes #32139
For performance reasons, we only used a partial parsing to check the blocks used in a pattern, the issue with that is that the second step for parsing performs a lot of block normalizations:
So it has the potential to change the blocks used in a block pattern meaning the performance optimization actually breaks the logic. Potentially we could consider building a dedicated "parse" function that only returns the list of blocks used in an HTML string.
Testing instructions
Makes sure it appears in the patterns inserter.