Skip to content

Commit

Permalink
Added broken-feed handling again
Browse files Browse the repository at this point in the history
  • Loading branch information
kopertop committed Jun 13, 2019
1 parent fb2377e commit 6444e61
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/feedparser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ FeedParser.prototype.handleOpenTag = function (node){
this.xhtml['#'] += '>';
} else if ( this.stack.length === 0 &&
(n['#name'] === 'rss' ||
(!this.meta['#type'] && n['#name'] === 'channel') ||
(n['#local'] === 'rdf' && _.nslookup([n['#uri']], 'rdf')) ||
(n['#local'] === 'feed'&& _.nslookup([n['#uri']], 'atom')) ) ) {
Object.keys(n['@']).forEach(function(name) {
Expand All @@ -191,6 +192,10 @@ FeedParser.prototype.handleOpenTag = function (node){
this.meta['#type'] = 'rss';
this.meta['#version'] = n['@']['version'];
break;
case 'channel':
this.meta['#type'] = 'rss';
this.meta['#version'] = n['@']['version'];
break;
case 'rdf':
this.meta['#type'] = 'rdf';
this.meta['#version'] = n['@']['version'] || '1.0';
Expand Down

0 comments on commit 6444e61

Please sign in to comment.