# HG changeset patch # User Guido Berhoerster # Date 1548055372 -3600 # Node ID 104a1faebd432593bcc6c6281645d428a5665e6b # Parent 15b828787c8bc379ae5ec23508c6b1323c501eba Fix XPath query syntax diff -r 15b828787c8b -r 104a1faebd43 js/feed-parser.js --- a/js/feed-parser.js Sun Jan 20 17:52:22 2019 +0100 +++ b/js/feed-parser.js Mon Jan 21 08:22:52 2019 +0100 @@ -341,7 +341,8 @@ } let linkElement = feedQueryXPath(this.document, entryElement, - './atom03:link[@href][@rel~="alternate"]'); + './atom03:link[@href][contains(concat(" ", ' + + 'normalize-space(@rel), " "), " alternate ")]'); if (linkElement !== null) { link = parseURL(linkElement.getAttribute('href'), this.url); } @@ -515,7 +516,8 @@ } let linkElement = feedQueryXPath(this.document, entryElement, - './atom:link[@href][not(@rel) or @rel~="alternate"]'); + './atom:link[@href][not(@rel) or contains(concat(" ", ' + + 'normalize-space(@rel), " "), " alternate ")]'); if (linkElement !== null) { link = parseURL(linkElement.getAttribute('href'), this.url); } @@ -540,7 +542,9 @@ } for (let enclosureElement of feedQueryXPathAll(this.document, - entryElement, './atom:link[@href][@rel~="enclosure"]')) { + entryElement, './atom:link[@href]' + + '[contains(concat(" ", normalize-space(@rel), " "), ' + + '" enclosure ")]')) { try { let entryFile = this.parseAtomEntryFile(enclosureElement); files.push(entryFile);