Skip to content

Paragraphs in Classic block lose classes during conversion #42172

@galbaras

Description

@galbaras

Description

The following code in a Classic block

<p class="teaser">Get value for money now. Click the button and contact us for a high-quality, used copier that works like new, but costs a lot less.</p>

Is converted into this code

<!-- wp:paragraph -->
<p>Get value for money now. Click the button and contact us for a high-quality, used copier that works like new, but costs a lot less.</p>
<!-- /wp:paragraph -->

Since there's some styling based on the teaser class, this conversion makes the page lose that styling.

The expected behaviour, of course, is to retain the class, either in the tag or in the block definition, and rendering it correctly at the front-end.

Seems related to #5028 (closed) and #11211 (open). Maybe paragraph conversion should be revisited holistically.

Step-by-step reproduction instructions

  1. Create a Classic block with the above example
  2. Convert it to blocks
  3. Check the code

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.0

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

Yes

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

No

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions