Repository navigation
fix(feed): list post authors as dc:creator instead of Atom-style author - #2578
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
Both feeds built each item's authors as <author><name>…</name><uri>…</uri></author>. That is Atom markup. In RSS 2.0, <author> is a text element that must hold an email address, and <name>/<uri> are not defined inside it, so feed validators reject the items and readers ignore the author. getAuthorsCustomData() now emits one Dublin Core <dc:creator> element per author, which is the usual way to name authors in RSS. Both feeds declare the dc namespace through a shared RSS_NAMESPACES constant passed to @astrojs/rss as `xmlns`. RSS has no equivalent of the author URI, so the GitHub profile link is dropped from the feeds; it is still shown on the site. Author names are now XML-escaped. @astrojs/rss parses customData as XML, so a name containing "<" used to be read as markup. Add tests/unit/rss.test.mjs, which renders a feed through @astrojs/rss's getRssString() and checks for the namespace, the dc:creator elements and the escaping. Fixes expressjs#2577 Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
✅ Deploy Preview for expressjscom-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This branch has not been deployed
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.

Fixes #2577
Both feeds (
/feed.xmland/vulnerabilities.xml) wrote each author as an Atom-style<author><name>…</name><uri>…</uri></author>. RSS 2.0's<author>has to contain an email address, so validators reject those items and readers drop the author. Each author is now written as a Dublin Core<dc:creator>, and both feeds declare thedcnamespace through a sharedRSS_NAMESPACESconstant.<author><name>Ulises Gascon</name><uri>https://github.com/UlisesGascon</uri></author><dc:creator>Ulises Gascon</dc:creator>RSS has nowhere to put an author URI, so the GitHub profile link no longer appears in the feeds. The site still shows it. Author names are also XML-escaped now:
@astrojs/rssparsescustomDataas XML, so a<in a name would have been read as markup.Validation
tests/unit/rss.test.mjsrenders a feed through@astrojs/rss'sgetRssString()and checks the namespace, thedc:creatorelements and the escaping. The author tests fail onmain, and the escaping test fails without the escaping. The tests pass on Node.js 24.15 (the.nvmrcversion) and on 24.22.npm run checkandnpm run test:unit(71 tests) pass.npm run buildpasses. Both generated feeds declarexmlns:dc, contain no<author>elements, and parse as well-formed XML.