WordPress/wporg-news-2021

Prevent orphans in content

Closed this issue · 2 comments

Orphans, lone words at the ends of blocks of text, are commonplace across the freshly redesigned parts of WordPress.org. In various News posts, orphans appear in both titles and body content for common breakpoints.

CleanShot 2023-07-27 at 09 39 36@2x

CleanShot 2023-07-27 at 09 41 23@2x

While orphans can sometimes be addressed with the manual addition of a non-breaking space, that is not possible in post titles, and trying to manually adjust body text is an exercise in futility due to the variety of screen/window sizes, contributors, etc. I'd like to propose that this be addressed within the theme.

@adamwoodnz implemented a fix for WP20.WordPress.net, which could be used here. There are also javascript options for this.

Transferred to the News theme repo, as I realised News does not use the parent theme. We can duplicate the solution there.

PR is in progress for the Parent theme, which we can replicate in News if effective.