Skip to content

Commit 6444e61

Browse files
committed
Added broken-feed handling again
1 parent fb2377e commit 6444e61

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/feedparser/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ FeedParser.prototype.handleOpenTag = function (node){
177177
this.xhtml['#'] += '>';
178178
} else if ( this.stack.length === 0 &&
179179
(n['#name'] === 'rss' ||
180+
(!this.meta['#type'] && n['#name'] === 'channel') ||
180181
(n['#local'] === 'rdf' && _.nslookup([n['#uri']], 'rdf')) ||
181182
(n['#local'] === 'feed'&& _.nslookup([n['#uri']], 'atom')) ) ) {
182183
Object.keys(n['@']).forEach(function(name) {
@@ -191,6 +192,10 @@ FeedParser.prototype.handleOpenTag = function (node){
191192
this.meta['#type'] = 'rss';
192193
this.meta['#version'] = n['@']['version'];
193194
break;
195+
case 'channel':
196+
this.meta['#type'] = 'rss';
197+
this.meta['#version'] = n['@']['version'];
198+
break;
194199
case 'rdf':
195200
this.meta['#type'] = 'rdf';
196201
this.meta['#version'] = n['@']['version'] || '1.0';

0 commit comments

Comments
 (0)