-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add item content #36
base: master
Are you sure you want to change the base?
Add item content #36
Conversation
Looks good so far, but there is no test for this case. |
I added it to the tests. The namespace you mentioned seems to already be included here: https://github.com/dylang/node-rss/blob/master/lib/rss.js#L94 |
ping - just seeing if anyone can review my updates to the latest comment and give the thumbs up to merge? |
With the current 1.1.1 release, you can add var RSS = require('rss');
/* let's create an rss feed */
var feed = new RSS({
title: 'title',
description: 'description',
custom_namespaces : {
"content" : "http://purl.org/rss/1.0/modules/content/"
},
});
// Add an item/article
feed.item({
title: 'Item Title ',
description: 'The description',
custom_elements: [
{
"content:encoded":
{
_cdata: "This is the long content. <b>This & That</b>"
}
}
]
});
// generate xml with default indent (4 sp)
var xml = feed.xml({indent: true});
console.log(xml); <?xml version="1.0" encoding="UTF-8"?>
<rss 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" version="2.0">
<channel>
<title><![CDATA[title]]></title>
<description><![CDATA[description]]></description>
<link>https://github.com/dylang/node-rss</link>
<generator>RSS for Node</generator>
<lastBuildDate>Mon, 22 Dec 2014 22:52:32 GMT</lastBuildDate>
<item>
<title><![CDATA[Item Title ]]></title>
<description><![CDATA[The description]]></description>
<guid isPermaLink="false">Item Title </guid>
<content:encoded><![CDATA[This is the long content. <b>This & That</b>]]></content:encoded>
</item>
</channel>
</rss> |
@efuquen did the custom_namespaces functionality example shown in the previous comment accomplish the same goal as you intended with your pull request? |
No description provided.