dylang / node-rss

RSS feed generator for Node.
https://npmjs.org/package/rss
MIT License
999 stars 133 forks source link

rss feed not handling html anchor tags properly #76

Open natashache opened 6 years ago

natashache commented 6 years ago

I generated a podcast RSS feed using a module derived from node-rss. The feed works fine in general. But the text content I have within the content:encoded includes some html, especially url links wrapped in tag. And those are not being recognized by iTunes. Here is the xml for one item in my feed

        <item>
          <title><![CDATA[How To Read People's Energy In 3 Seconds, Ep 18]]></title>
          <description><![CDATA[some words...<p>Subscribe to The True Voyage: A Soundcast For The Journey Within on <a href="https://mysoundwise.com/soundcasts/1508293913676s">Soundwise</a></p>]]></description>
          <link>https://mysoundwise.com/episodes/1517178943974e</link>
          <guid isPermaLink="true">https://mysoundwise.com/episodes/1517178943974e</guid>
          <category><![CDATA[Self-Help]]></category>
          <category><![CDATA[Spirituality]]></category>
          <category><![CDATA[Philosophy]]></category>
          <dc:creator><![CDATA[Natasha Che]]></dc:creator>
          <pubDate>Sun, 28 Jan 2018 22:45:08 GMT</pubDate>
          <enclosure url="https://website.com/audiofile.mp3" length="0" type="audio/mpeg"/>
          <content:encoded><![CDATA[some words...<p>Subscribe to <a href="https://mysoundwise.com/soundcasts/1508293913676s">The True Voyage: A Soundcast For The Journey Within</a> on <a href="https://mysoundwise.com/soundcasts/1508293913676s">Soundwise</a></p>]]></content:encoded>
          <itunes:author>Natasha Che</itunes:author>
          <itunes:subtitle>How To Read People&apos;s Energy In 3 Seconds, Ep 18</itunes:subtitle>
          <itunes:summary>some words...Subscribe to &lt;a href=&quot;https://mysoundwise.com/soundcasts/1508293913676s&quot;&gt;The True Voyage: A Soundcast For The Journey Within&lt;/a&gt; on &lt;a href=&quot;https://mysoundwise.com/soundcasts/1508293913676s&quot;&gt;Soundwise&lt;/a&gt;&lt;/p&gt;</itunes:summary>
          <itunes:explicit>No</itunes:explicit>
          <itunes:duration>1177</itunes:duration>
          <itunes:image href="https://website.com/image.jpg"/>
          <itunes:title>How To Read People&apos;s Energy In 3 Seconds, Ep 18</itunes:title>
        </item>

It seems iTunes is rendering the content in content:encoded in their episode description. But the url links are not being recognized for some reason. I used

            customElements: [
              {
                'content:encoded':
                  {
                    _cdata: 'some string including html tags'
                  }
              }
            ]

for the content:encoded element. It looks correct to me. Not sure why the anchor tags are not being picked up by iTunes.