Skip to content

Post Author Biography: Fix horizontal overflow with long unbroken text - #81018

Merged
im3dabasia merged 2 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/post-author-biography-overflow
Aug 4, 2026
Merged

Post Author Biography: Fix horizontal overflow with long unbroken text#81018
im3dabasia merged 2 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/post-author-biography-overflow

Conversation

@R1shabh-Gupta

Copy link
Copy Markdown
Contributor

What?

Closes #70849

Fixes horizontal overflow in the Post Author Biography block when the author's biography contains a long string of text with no spaces.

Why?

The .wp-block-post-author-biography selector sets white-space: pre-wrap, which only wraps text at natural break points (spaces). If a biography contains one long unbroken run of characters, there's nowhere to wrap, so the text overflows the block horizontally and forces a scrollbar.

How?

Added overflow-wrap: break-word; to .wp-block-post-author-biography, so long unbroken text breaks within the block instead of overflowing it.

Testing Instructions

  1. Edit a user's biography (Users → your profile → Biographical Info) to a long string with no spaces, e.g. Thisisaverylongstringofwordswithoutanyspacesorbreaksitjustkeepsgoingandgoingandwillcausehorizontalscrollingissuesbecausetherearenowordbreak (repeat until it's clearly wider than the content area).
  2. Create or edit a post authored by that user, insert a Post Author Biography block, and publish it.
  3. View the post on the front end and confirm the biography text wraps within the block and no horizontal scrollbar appears.

Screenshots or screencast

Before After
Screenshot 2026-07-31 at 4 30 29 PM Screenshot 2026-07-31 at 4 31 03 PM

Use of AI Tools

None

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jul 31, 2026
@R1shabh-Gupta
R1shabh-Gupta marked this pull request as ready for review July 31, 2026 11:06
@github-actions

github-actions Bot commented Jul 31, 2026

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.

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

Co-authored-by: R1shabh-Gupta <rishabhwp@git.wordpress.org>
Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: Adi-ty <iamadisingh@git.wordpress.org>

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

@shail-mehta shail-mehta added [Type] Bug An existing feature does not function as intended [Block] Post Author Biography Affects the Post Author Biography Block labels Jul 31, 2026

@im3dabasia im3dabasia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch!

Matches what we already do on quote, pullquote, and embed, and I confirmed it fixes the reported overflow.

Non-blocking, for the record: overflow-wrap: break-word doesn't contribute to min-content sizing, so inside a Row (is-layout-flex) the block still overflows even with this patch.

Embed had the identical gap until #73109 added flex: 1 1 0%; min-width: 0 for flex groups, and Columns avoids it because .wp-block-column carries word-break: break-word (columns/style.scss:98), which unlike break-word on overflow-wrap does affect min-content. quote/pullquote/embed all share this gap, so it's a pre-existing pattern rather than anything this PR introduces, happy to leave it for a follow-up.

I'll need a second opinion on this before we merge!

// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;
white-space: pre-wrap;
overflow-wrap: break-word;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small ask: could you add this trailing comment? // Break long strings of text without spaces so they don't overflow the block., keeps the rules greppable as a set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @im3dabasia, thanks for the suggestion! I've added the trailing comment as requested.

@Mamaduka

Mamaduka commented Aug 4, 2026

Copy link
Copy Markdown
Member

Looks good. Thanks, @R1shabh-Gupta and @im3dabasia!

@im3dabasia
im3dabasia merged commit 1e15b9d into WordPress:trunk Aug 4, 2026
43 of 44 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Post Author Biography Affects the Post Author Biography Block [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.

Post Author Biography block: Long text without spaces causes horizontal overflow

4 participants