dylang / node-rss

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

No support for `content:encoded` #68

Closed aintgoin2goa closed 7 years ago

aintgoin2goa commented 7 years ago

I was hoping to use this module to create a feed which includes HTML content. The module consuming this feed expects to find the full content inside a <content:encoded> tag. This seems to be in line with the spec but node-rss doesn't seem to support this and when I attempt to use custom elements it encodes the html.

Could you please consider adding support for <content:encoded> - maybe a new option to item()?

rixrix commented 7 years ago

@aintgoin2goa maybe this is what you're looking for ?

{
    title: 'some title',
    custom_elements: [
        {
            "content:encoded": {
                  _cdata: "your contents here"
             }
        }
    ]
}

and it'll generate this xml

...
<item>
   <title><![CDATA[some title]]></title>
    <content:encoded>
         <![CDATA[
                your contents here
         ]]>
    </content:encoded>
</item>
...

hope that helps you out, cheers

rixrix commented 7 years ago

actually, a good example here #36

aintgoin2goa commented 7 years ago

Thanks for replying. When I tried to do this it seemed to encode the html I passed to it (like &gt;p&lt; instead of <p> but maybe I missed something? I will try using the example you gave, thanks for your help 👍