fix(feed): escape author and title fields in Atom feed template#658
Open
thostetler wants to merge 1 commit into
Open
fix(feed): escape author and title fields in Atom feed template#658thostetler wants to merge 1 commit into
thostetler wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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.titlewithxml_escapein the Atom feed template - Escape
post.authorwithxml_escapein the Atom feed template
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b8b289f to
9c695d6
Compare
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
9c695d6 to
ee8794d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
<summary>to each entry — uses post.description from front matter if present, falls back to the first 50 words of rendered text