Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function getSize(filename) {
function generateXML (data){

var channel = [];
channel.push({ title: { _cdata: data.title } });
channel.push({ description: { _cdata: data.description || data.title } });
channel.push({ title: data.disable_cdata ? data.title: { _cdata: data.title }});
channel.push({ description: data.disable_cdata ? data.description: { _cdata: data.description || data.title } });
channel.push({ link: data.site_url || 'http://github.com/dylang/node-rss' });
// image_url set?
if (data.image_url) {
Expand Down Expand Up @@ -140,6 +140,7 @@ function RSS (options, items) {

this.title = options.title || 'Untitled RSS Feed';
this.description = options.description || '';
this.disable_cdata = options.disable_cdata || false;
this.generator = options.generator || 'RSS for Node';
this.feed_url = options.feed_url;
this.site_url = options.site_url;
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var feed = new RSS(feedOptions);

* `title` **string** Title of your site or feed
* `description` _optional_ **string** A short description of the feed.
* `disable_cdata` _optional_ **boolean** Disables CDATA for `title` and `description` if true.
* `generator` _optional_ **string** Feed generator.
* `feed_url` **url string** Url to the rss feed.
* `site_url` **url string** Url to the site that the feed is for.
Expand Down