Skip to content

Fix XML escaping in RSS feed generator#871

Open
jpurnell wants to merge 1 commit intotwostraws:mainfrom
jpurnell:fix/rss-xml-escaping
Open

Fix XML escaping in RSS feed generator#871
jpurnell wants to merge 1 commit intotwostraws:mainfrom
jpurnell:fix/rss-xml-escaping

Conversation

@jpurnell
Copy link
Copy Markdown
Contributor

Summary

  • Article titles and site metadata containing special XML characters (&, <, >, ", ') produced invalid RSS that feed readers rejected
  • Added xmlEscape() helper to FeedGenerator to properly encode non-CDATA text fields (item titles, site name, site description)
  • Fields already wrapped in <![CDATA[...]]> (description, author, tags, content) are unaffected

Test plan

  • Added test verifying & in article titles is escaped to &amp; in feed output
  • All existing FeedGenerator tests continue to pass
  • Validated output with xmllint --noout on a real feed containing titles with & characters

Article titles and site metadata containing special XML characters
(& < > " ') produced invalid RSS that feed readers rejected. Added
xmlEscape() to properly encode non-CDATA text fields in the feed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant