Skip to content

Commit

Permalink
Merge pull request #242 from d-line/master
Browse files Browse the repository at this point in the history
Build fix related to 'rdf:about'
  • Loading branch information
rbren committed Mar 12, 2023
2 parents e2e2f4d + f76cc42 commit 4c1a0dc
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 3 additions & 1 deletion lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ class Parser {
item.guid = xmlItem.guid[0];
if (item.guid._) item.guid = item.guid._;
}
item['rdf:about'] = xmlItem.$['rdf:about']
if (xmlItem.$ && xmlItem.$['rdf:about']) {
item['rdf:about'] = xmlItem.$['rdf:about']
}
if (xmlItem.category) item.categories = xmlItem.category;
this.setISODate(item);
return item;
Expand Down
25 changes: 25 additions & 0 deletions test/output/craigslist.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions test/output/pagination-links.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
"feed": {
"items": [
{
"content": "<div>The First Episode</div>",
"contentSnippet": "The First Episode",
"title": "The First Episode",
"link": "https://example.test/episode?id=283843",
"pubDate": "Thu, 21 Jan 2021 18:58:00 +1100",
"enclosure": {
"url": "https://example.test/test-audio.mp3",
"length": "38068096",
"type": "audio/mpeg",
"url": "https://example.test/test-audio.mp3"
"type": "audio/mpeg"
},
"content": "<div>The First Episode</div>",
"contentSnippet": "The First Episode",
"guid": "a6f22abe-be5c-4a37-8f4b-8be3d69b0235",
"isoDate": "2021-01-21T07:58:00.000Z",
"itunes": {
"author": "Steve Thompson",
"duration": "39:27",
"explicit": "No",
"image": "https://example.test/test-image.jpg",
"subtitle": "The First Episode...",
"summary": "The First Episode"
},
"link": "https://example.test/episode?id=283843",
"pubDate": "Thu, 21 Jan 2021 18:58:00 +1100",
"title": "The First Episode"
"summary": "The First Episode",
"explicit": "No",
"duration": "39:27",
"image": "https://example.test/test-image.jpg"
}
}
],
"feedUrl": "http://example.org/index.atom?page=3",
Expand Down
Loading

0 comments on commit 4c1a0dc

Please sign in to comment.