# HG changeset patch # User Guido Berhoerster # Date 1562165837 -7200 # Node ID b68880838990f5a4f13c2a0abd87f1cddcc6ee25 # Parent 586eebf8efb7ca44be3cca877616ee773dce2ec1 Add support for the RSS Content module to the RSS 2.0 feed parser diff -r 586eebf8efb7 -r b68880838990 js/feed-parser.js --- a/js/feed-parser.js Wed Jul 03 15:51:36 2019 +0200 +++ b/js/feed-parser.js Wed Jul 03 16:57:17 2019 +0200 @@ -13,6 +13,7 @@ ATOM10: 'http://www.w3.org/2005/Atom', RSS09: 'http://my.netscape.com/rdf/simple/0.9/', RSS10: 'http://purl.org/rss/1.0/', + CONTENT: 'http://purl.org/rss/1.0/modules/content/', XHTML: 'http://www.w3.org/1999/xhtml', PARSERERROR: 'http://www.mozilla.org/newlayout/xml/parsererror.xml' } @@ -75,6 +76,8 @@ return XMLNS.RSS09; case 'rss10': return XMLNS.RSS10; + case 'content': + return XMLNS.CONTENT; } return null; } @@ -749,10 +752,16 @@ date = parseDate(pubDateElement.textContent); } - let descriptionElement = feedQueryXPath(this.document, itemElement, - './description'); - if (descriptionElement !== null) { - content = descriptionElement.textContent.trim(); + let encodedElement = feedQueryXPath(this.document, itemElement, + './content:encoded'); + if (encodedElement !== null) { + content = encodedElement.textContent.trim(); + } else { + let descriptionElement = feedQueryXPath(this.document, itemElement, + './description'); + if (descriptionElement !== null) { + content = descriptionElement.textContent.trim(); + } } for (let enclosureElement of