Skip to content

Fix pasted image dimensions in RichText content#78639

Open
Mustafabharmal wants to merge 1 commit into
WordPress:trunkfrom
Mustafabharmal:fix/78342-richtext-pasted-image-dimensions
Open

Fix pasted image dimensions in RichText content#78639
Mustafabharmal wants to merge 1 commit into
WordPress:trunkfrom
Mustafabharmal:fix/78342-richtext-pasted-image-dimensions

Conversation

@Mustafabharmal

Copy link
Copy Markdown
Contributor

What?

Fixes an issue where images pasted into RichText-backed block content can render at incorrect dimensions.
Closes #78342

Why?

The current responsive image rule only applies to images with a wp-image-* class. Images pasted into RichText content do not always carry that class, so they can miss the baseline responsive sizing and render oversized.

How?

This updates the shared block-library image responsiveness styling so pasted images in RichText content receive the same baseline constrained sizing.

Testing Instructions

  1. Add a Table block.
  2. Paste an image into a table cell.
  3. Confirm the image no longer renders oversized.
  4. Repeat with another RichText-backed block such as Pullquote if needed.

Screenshots or screencast

Before:

Before.scss.Fix.mov

After:

After.scss.Fix.mov

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label May 25, 2026
@github-actions

Copy link
Copy Markdown

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 props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @rickmgithub.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: rickmgithub.

Co-authored-by: Mustafabharmal <mustafabharmal@git.wordpress.org>
Co-authored-by: vishnucmsminds <prajapatvishnu@git.wordpress.org>
Co-authored-by: dpmehta <mehtadev@git.wordpress.org>
Co-authored-by: rinazrina <rinazrina@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable labels May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Package] Block library /packages/block-library [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy/pasting images into RichText can result in incorrect image dimensions

2 participants