Skip to content

Conversation

@jorgefilipecosta
Copy link
Member

@jorgefilipecosta jorgefilipecosta commented Dec 31, 2025

Fixes #71854

Fixes incorrect quotation mark rendering in the Query Title block when the search term has a trailing space.

When a user searches with a trailing space (e.g., "Kitchen Sink QA Page "), the Query Title block displays incorrect quotation marks:

Before:
Screenshot 2025-12-31 at 17 06 34

After:
Screenshot 2025-12-31 at 17 06 27

To fix this we replace straight ASCII quotes (") with HTML entity curly quotes (“ for left and ” for right) in the translatable strings.
This follows the existing pattern already used in the comments-title block:

// packages/block-library/src/comments-title/index.php:29
$post_title = sprintf( __( '“%s”' ), get_the_title() );

Testing Instructions

  1. Go to a search page: /?s=Kitchen+Sink+QA+Page+
  2. Verify the title shows proper curly quotes: `Search results for: “Kitchen Sink QA Page ”
  3. Test without trailing space to ensure normal behavior is preserved

When a search term has a trailing space, wptexturize incorrectly
converts the closing quotation mark to an opening one because
it sees the space-before-quote pattern.

Replace straight ASCII quotes with HTML entity curly quotes
(“ and ”) which bypasses wptexturize entirely.

This follows the existing pattern used in the comments-title block.

Fixes #71854
@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Block] Query Title Affects the Query Title Block labels Dec 31, 2025
@github-actions github-actions bot added the [Package] Block library /packages/block-library label Dec 31, 2025
@github-actions
Copy link

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: jorgefilipecosta <[email protected]>
Co-authored-by: sabernhardt <[email protected]>

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

@github-actions
Copy link

Flaky tests detected in 924078c.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20623593670
📝 Reported issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Query Title Affects the Query Title 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.

Query Title: Incorrect quotation mark character at the end of the search results title

2 participants