Skip to content

Conversation

himanshupathak95
Copy link
Contributor

What?

Closes #70477
Follows the implementation of: WordPress/wordpress-develop#9042 by @Infinite-Null
Related Trac ticket: https://core.trac.wordpress.org/ticket/63611

Fixes RSS Block to properly handle HTML entities in feed titles by decoding them before stripping tags and escaping for display.

Why?

RSS feeds from third-party sources sometimes include HTML entities in their titles. Currently, these entities are displayed as literal text instead of being properly decoded and stripped, resulting in unsightly <em> appearing in the rendered titles on the frontend.

How?

Modified the title processing in packages/block-library/src/rss/index.php to:

  1. First, decode HTML entities using html_entity_decode() with appropriate flags
  2. Then strip HTML tags as before
  3. Finally, escape the result for safe HTML output

Testing Instructions

  1. Create a new post or page in the editor
  2. Add an RSS block
  3. Use some RSS feed URL (example URL )
  4. Save and view the page on the frontend
  5. Verify that everything works as expected

Screenshots

Before After
Screenshot 2025-06-23 at 13 04 30 Screenshot 2025-06-23 at 13 05 00

@himanshupathak95 himanshupathak95 marked this pull request as ready for review June 23, 2025 07:48
Copy link

github-actions bot commented Jun 23, 2025

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: himanshupathak95 <abcd95@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: n8finch <n8finch@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: andreawetzel <awetz583@git.wordpress.org>

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

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] RSS Affects the RSS Block - used to display entries from an RSS/Atom feed labels Jun 23, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM!

A similar fix was applied to the wp_widget_rss_output() function in the core PR: WordPress/wordpress-develop#9042

@t-hamano t-hamano merged commit 56c8a23 into WordPress:trunk Jun 30, 2025
59 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.2 milestone Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] RSS Affects the RSS Block - used to display entries from an RSS/Atom feed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RSS Block doesn't remove HTML Entities from a feed's titles
3 participants