Add item content#36
Open
efuquen wants to merge 3 commits intodylang:masterfrom
somespider:add-item-content
Open
Add item content#36efuquen wants to merge 3 commits intodylang:masterfrom somespider:add-item-content
efuquen wants to merge 3 commits intodylang:masterfrom
somespider:add-item-content
Conversation
Contributor
|
Looks good so far, but there is no test for this case. |
Author
|
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 |
Author
|
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>http://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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.