Skip to content

RSS2 to feed contains titles for enclosures #218

Description

@Varbin

Describe the bug
Enclosures may not have a title attribute.

To Reproduce
Add Items with Enclosures that have titles. The title attribute is included in the RSS2 feed (it is only valid it Atom).

Expected behavior
The title attribute is not added to an RSS2 feed.

Actual behavior
The title attribute is added to an RSS2 feed.

Screenshots

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Amazon Paws</title>
        <link>https://amazonpaws.com/</link>
        <description>The paw prints Amazon leaves on the world.</description>
        <lastBuildDate>Thu, 12 Jun 2025 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <copyright>Some rights reserved</copyright>
        <atom:link href="https://amazonpaws.com/feeds/rss" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[Test]]></title>
            <link>https://amazonpaws.com/print/68530ed6c9ab26ccac87e162</link>
            <guid isPermaLink="false">https://amazonpaws.com/print/68530ed6c9ab26ccac87e162</guid>
            <pubDate>Thu, 12 Jun 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Amazon ...]]></description>
            <content:encoded><![CDATA[Amazon ...]]></content:encoded>
            <enclosure length="0" type="image/png" url="http://127.0.0.1:9000/paws/672923af6a5909f584d0db03f328303c.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Credential=root%2F20250618%2Fus-east1%2Fs3%2Faws4_request&amp;X-Amz-Date=20250618T200555Z&amp;X-Amz-Expires=604800&amp;X-Amz-Signature=c5af713ff72cb3d6cacf3f5957978cc30d58e9050541505881d7fec9388e80e7&amp;X-Amz-SignedHeaders=host&amp;x-amz-checksum-mode=ENABLED&amp;x-id=GetObject" title="Caption"/>
        </item>
        <item>
            <title><![CDATA[Amazon ...]]></title>
            <link>https://amazonpaws.com/print/68531aadc9ab26ccac87e163</link>
            <guid isPermaLink="false">https://amazonpaws.com/print/68531aadc9ab26ccac87e163</guid>
            <pubDate>Thu, 01 Jan 2015 00:00:00 GMT</pubDate>
            <description><![CDATA[-]]></description>
            <content:encoded><![CDATA[-]]></content:encoded>
        </item>
    </channel>
</rss>

It fails the validator of the W3C:

Image

Versions (please complete the following information):

  • NodeJS: v20.19.2
  • TypeScript: 5.8.3
  • npm/yarn: npm 10.8.2
  • feed: 5.1.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions