reallysimple 0.4.16 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/reallysimple.js +19 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reallysimple",
|
|
3
3
|
"description": "A Node package that reads RSS-like feeds and calls back with a simple, consistent JavaScript object. Easy to use, hides the history.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.17",
|
|
5
5
|
"author": "Dave Winer <dave@scripting.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"url": "https://github.com/scripting/reallysimple.git"
|
|
14
14
|
},
|
|
15
15
|
"dependencies" : {
|
|
16
|
+
"marked": "*",
|
|
17
|
+
"node-emoji": "*",
|
|
16
18
|
"opml": "*",
|
|
17
19
|
"daveutils": "*",
|
|
18
20
|
"davefeedread": "*"
|
package/reallysimple.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var myProductName = "reallysimple", myVersion = "0.4.
|
|
1
|
+
var myProductName = "reallysimple", myVersion = "0.4.17";
|
|
2
2
|
|
|
3
3
|
exports.readFeed = readFeed;
|
|
4
4
|
exports.convertFeedToOpml = convertFeedToOpml;
|
|
@@ -9,6 +9,8 @@ const request = require ("request");
|
|
|
9
9
|
const process = require ("process");
|
|
10
10
|
const opml = require ("opml");
|
|
11
11
|
const davefeedread = require ("davefeedread");
|
|
12
|
+
const marked = require ("marked"); //7/18/22 by DW
|
|
13
|
+
const emoji = require ("node-emoji"); //7/18/22 by DW
|
|
12
14
|
|
|
13
15
|
const allowedHeadNames = [
|
|
14
16
|
"title", "link", "description", "language", "copyright", "managingEditor", "webMaster", "lastBuildDate", "pubDate", "category",
|
|
@@ -58,6 +60,17 @@ function getItemPermalink (item) {
|
|
|
58
60
|
}
|
|
59
61
|
return (undefined);
|
|
60
62
|
}
|
|
63
|
+
function markdownProcess (markdowntext) {
|
|
64
|
+
var htmltext = marked.parse (markdowntext);
|
|
65
|
+
return (htmltext);
|
|
66
|
+
}
|
|
67
|
+
function emojiProcess (s) {
|
|
68
|
+
function addSpan (code, name) {
|
|
69
|
+
return ("<span class=\"spRssEmoji\">" + code + "</span>");
|
|
70
|
+
}
|
|
71
|
+
return (emoji.emojify (s, undefined, addSpan));
|
|
72
|
+
}
|
|
73
|
+
|
|
61
74
|
function convertFeedToOpml (theFeed) { //use this if you want to show an RSS feed in an outline
|
|
62
75
|
var theOutline = {
|
|
63
76
|
opml: {
|
|
@@ -228,6 +241,11 @@ function convertFeed (oldFeed, whenstart) {
|
|
|
228
241
|
newItem.enclosure = enc;
|
|
229
242
|
}
|
|
230
243
|
|
|
244
|
+
if (item ["source:markdown"] !== undefined) { //7/18/22 by DW
|
|
245
|
+
let markdowntext = item ["source:markdown"] ["#"];
|
|
246
|
+
newItem.description = markdownProcess (emojiProcess (markdowntext));
|
|
247
|
+
}
|
|
248
|
+
|
|
231
249
|
newFeed.items.push (newItem);
|
|
232
250
|
});
|
|
233
251
|
|