Skip to content

fix(feed): escape author and title fields in Atom feed template#658

Open
thostetler wants to merge 1 commit into
adsabs:masterfrom
thostetler:fix/rss-xml-escape-author-title
Open

fix(feed): escape author and title fields in Atom feed template#658
thostetler wants to merge 1 commit into
adsabs:masterfrom
thostetler:fix/rss-xml-escape-author-title

Conversation

@thostetler

@thostetler thostetler commented Jun 18, 2026

Copy link
Copy Markdown
Member

Three bugs in the Atom feed template. post.author and post.title were missing xml_escape, causing a parse error on any post with '&' in those fields (at least five affected). The limit:10 ran before the category filter, filling the feed window with same-date posts from both blog/ and scixblog/ collections. The 'contains blog' check also matched scixblog as a substring, doubling every entry.

  • Applied xml_escape to post.title and post.author
  • Pre-filter with where: "category", "blog" so limit:10 applies to the right set
  • Dropped the now-redundant in-loop category check
  • Added <summary> to each entry — uses post.description from front matter if present, falls back to the first 50 words of rendered text

@thostetler thostetler marked this pull request as ready for review June 18, 2026 18:24
@thostetler thostetler requested review from Copilot and shinyichen June 18, 2026 18:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Atom feed XML validity by escaping post metadata fields that can contain reserved XML characters (notably &), preventing feed parse failures for affected blog posts.

Changes:

  • Escape post.title with xml_escape in the Atom feed template
  • Escape post.author with xml_escape in the Atom feed template

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread help/common/feed.xml
@thostetler thostetler force-pushed the fix/rss-xml-escape-author-title branch from b8b289f to 9c695d6 Compare June 18, 2026 19:40
post.author and post.title were missing xml_escape, causing a parse
error on posts with '&' in those fields. The limit:10 ran before the
category filter, filling the window with same-date posts from both
blog/ and scixblog/ collections. The 'contains blog' check matched
scixblog as a substring, doubling every entry. post.id, post.url,
and the self-link href were also unescaped. The summary fallback
double-encoded HTML entities by running xml_escape after strip_html
without first decoding the entities strip_html leaves intact.

- Apply xml_escape to post.title, post.author, post.id, post.url
- Upgrade self-link href from http to https
- Pre-filter with where: "category", "blog" so limit:10 applies to
  the right set
- Drop the now-redundant in-loop category check
- Add <summary> to each entry — uses post.description from front
  matter if present, falls back to first 50 words of rendered text
- Fix double-encoding in fallback: decode HTML entities before
  xml_escape
@thostetler thostetler force-pushed the fix/rss-xml-escape-author-title branch from 9c695d6 to ee8794d Compare June 18, 2026 19:51
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.

2 participants