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
Add CSS class to paragraph block #47282
base: trunk
Are you sure you want to change the base?
Conversation
I'll be working on fixing tests and all. |
# Conflicts: # lib/compat/wordpress-6.2/block-patterns/centered-footer-with-social-links.php # lib/compat/wordpress-6.2/block-patterns/centered-footer.php # lib/compat/wordpress-6.2/block-patterns/footer-with-large-font-size.php # lib/compat/wordpress-6.2/block-patterns/simple-header-with-image.php
…k and affect test results.
# Conflicts: # packages/block-editor/src/hooks/test/__snapshots__/align.native.js.snap # packages/block-library/src/cover/test/__snapshots__/edit.native.js.snap # packages/block-library/src/embed/test/__snapshots__/index.native.js.snap # packages/e2e-tests/specs/editor/blocks/__snapshots__/heading.test.js.snap # packages/e2e-tests/specs/editor/blocks/pullquote.test.js # packages/e2e-tests/specs/editor/plugins/__snapshots__/container-blocks.test.js.snap # packages/e2e-tests/specs/editor/plugins/__snapshots__/cpt-locking.test.js.snap # packages/e2e-tests/specs/editor/plugins/__snapshots__/inner-blocks-render-appender.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/block-deletion.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/block-grouping.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/block-hierarchy-navigation.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/embedding.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/inserting-blocks.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/keep-styles-on-block-transforms.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/links.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/list-view.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/multi-block-selection.test.js.snap # packages/e2e-tests/specs/editor/various/__snapshots__/rich-text.test.js.snap # packages/e2e-tests/specs/editor/various/block-grouping.test.js # packages/e2e-tests/specs/editor/various/format-library/__snapshots__/text-color.test.js.snap # packages/e2e-tests/specs/editor/various/multi-block-selection.test.js # packages/e2e-tests/specs/widgets/editing-widgets.test.js # packages/format-library/src/text-color/test/__snapshots__/index.native.js.snap # packages/react-native-editor/__device-tests__/helpers/test-data.js # packages/react-native-editor/src/initial-html.js # packages/rich-text/src/test/__snapshots__/index.native.js.snap # test/e2e/specs/editor/blocks/__snapshots__/List-can-be-exited-to-selected-paragraph-1-chromium.txt # test/e2e/specs/editor/blocks/__snapshots__/List-selects-all-transformed-output-1-chromium.txt # test/e2e/specs/editor/various/font-size-picker.spec.js # test/integration/__snapshots__/blocks-raw-handling.test.js.snap
# Conflicts: # packages/e2e-tests/specs/editor/various/__snapshots__/multi-block-selection.test.js.snap # packages/e2e-tests/specs/editor/various/multi-block-selection.test.js
# Conflicts: # packages/e2e-tests/assets/large-post.html # packages/e2e-tests/assets/small-post-with-containers.html
…nction clicks the center, which creates an undesired test result.
We're coming up on 6.4 beta 1 and I'm curious where we stand. I can see some recent commits and requests for more feedback but I'm not seeing additional reviews come in. Where do we stand? |
Unfortunately, as we're now also past Beta 1 for 6.4, and based on the conversation above about this being a pretty major change, I think this should now be punted to 6.5. However, it would be great to aim to include it in the next Gutenberg release. |
This is an important change, but it's also a tough one to test because it touches so much. I think we need to start looking at it early if it's going to make 6.5, otherwise it will keep getting punted. |
Agree. Since it touches native files too it might be good to get a sign off list of reviewers. I've smoked tested this PR with existing P blocks and creating new ones and it works great, but the breadth of the changes makes me want a security blanket of concurring reviews 😄 |
Just thinking out loud: since the approach in this PR involves changing a lot of files, and alters how the block is serialized to post content, would it be worth investigating a subtle alternative that uses the That way the saved markup is never changed, and we wouldn't need to worry about backwards compat / support in the mobile apps as older versions would still see the earlier markup? I might very well be missing some context, and there could be a good reason to save the classname in post content, so apologies if I've missed something obvious there! |
Thanks for your comments 😄 I was out of the office. The number of files involved in this PR is related to updating the tests that involve the paragraph block, to include the CSS class. There were no changes to the logic of native, only updating tests and snapshots. The main changes are only these. I believe that, in favor of consistency with the behavior of other blocks, I would save the data with the class. But that may be subjective. But I'm thinking that maybe it is better to play safe and cover all scenarios where the data is retrieved (in case the post data is retrieved in some way other than being rendered). |
Hey all 👋 We are 1 week out from Beta 1 of WordPress 6.5. Is anyone working on getting this is before then? / What are the current blockers? |
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @apeatling. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core SVNIf you're a Core Committer, use this list when committing to
GitHub Merge commitsIf 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. |
Hi @fabiankaegy, Thanks for coming back to this one. I could rebase and fix the merge conflicts, but I believe that it'd be interesting to define if we're ok with the approach of having the class name in the markup, as I've seen some concerns about it. |
What?
Adding the
wp-block-paragraph
to the paragraph block elements.Fixes #46863
Why?
It was reported in #46863 that the style changes for the paragraph block were affecting all the paragraphs, and this was affecting other pieces of the site such as the site tagline (and others).
How?
Adding the
wp-block-paragraph
class to the paragraph block for new content, and parsing the block output to add it for previously generated content.Testing Instructions
For new content
wp-block-paragraph
class.For previously generated content
wp-block-paragraph
class was added to the previously generated content.For the problem reported in #46863
<p>
that doesn't have thewp-block-paragraph
class)Screenshots or screencast
Screen.Recording.2023-02-03.at.17.18.43.mov