diff --git a/lib/feedparser/index.js b/lib/feedparser/index.js index 7915725..7862864 100644 --- a/lib/feedparser/index.js +++ b/lib/feedparser/index.js @@ -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) { @@ -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';