Skip to content
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

Transforming to/from paragraph block from/to heading block does not maintain all formatting #69017

Open
3 of 6 tasks
eric-michel opened this issue Feb 3, 2025 · 3 comments
Open
3 of 6 tasks
Labels
[Feature] Block Transforms Block transforms from one block to another [Type] Bug An existing feature does not function as intended

Comments

@eric-michel
Copy link

Description

When transforming a heading block to a paragraph block (or vice versa), some formatting (such as font size and color) are maintained, but many (all?) of the typography options are not, most notably letter case and appearance.

This has been an annoyance for us and our clients for a considerable amount of time.

Step-by-step reproduction instructions

  1. Create a paragraph block with some text
  2. Set it to all caps via the Letter case typography option
  3. Transform the paragraph to a heading
  4. Note that the text returns to normal case

Screenshots, screen recording, code snippet

No response

Environment info

  • WP 6.7.1
  • Gutenberg plugin version 20.1.0
  • Twenty Twenty-Four theme version 1.3

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@eric-michel eric-michel added the [Type] Bug An existing feature does not function as intended label Feb 3, 2025
@t-hamano t-hamano added the [Feature] Block Transforms Block transforms from one block to another label Feb 4, 2025
@Rishit30G
Copy link
Contributor

Thanks for sharing the issue,

I was able to reproduce this issue; however, I feel there might be some intention behind it that I’m not entirely clear on, perhaps a maintainer can provide better insights.
I noticed that all capitalization is preserved when transitioning from Paragraph to Quote, but when transitioning from Paragraph to Heading or List, the casing is not maintained.

Sharing the screencast for the same:

Screen.Recording.2025-02-04.at.8.57.43.AM.mov

@im3dabasia
Copy link
Contributor

im3dabasia commented Feb 4, 2025

Hey @eric-michel, thank you for raising the issue.

I was able to reproduce what you described and can confirm that the issue occurs. The typography settings are not applied when transforming a block from a paragraph to a heading or vice versa. We should wait for discussion on whether this is the intended behavior or a bug.

Screen.Recording.2025-02-04.at.8.57.29.AM.mov

Edit: I noticed that the typography size settings are applied to both the heading and paragraph during block transformation.

Screen.Recording.2025-02-04.at.9.04.38.AM.mov

@eric-michel
Copy link
Author

Thank you both! I am hopeful that this is not intentional, as we frequently swap between heading and paragraph blocks and want to keep all formatting the same. I'm not sure what the reasoning would be behind maintaining font size and color but not other style attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Transforms Block transforms from one block to another [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants