diff --git a/frontend/ui/opdsparser.lua b/frontend/ui/opdsparser.lua index a1321b3a9..91ba4cfa8 100644 --- a/frontend/ui/opdsparser.lua +++ b/frontend/ui/opdsparser.lua @@ -78,16 +78,11 @@ function OPDSParser:parse(text) text = text:gsub('.-', '') -- luxl doesn't handle XML comments, so strip them text = text:gsub("", "") - -- luxl prefers
, the other two forms are valid in HTML, but will kick luxl's ass + -- luxl is also particular about the syntax for self-closing, empty & orphaned tags... + text = text:gsub("<(%l+)/>", "<%1 />") + -- We also need to handle the slash-less variants for br & hr... text = text:gsub("
", "
") - text = text:gsub("
", "
") - -- Same deal with hr text = text:gsub("
", "
") - text = text:gsub("
", "
") - -- It's also allergic to orphaned (As opposed to a balanced pair)... - text = text:gsub("", "") - -- Let's assume it might also happen to strong... - text = text:gsub("", "") -- Some OPDS catalogs wrap text in a CDATA section, remove it as it causes parsing problems text = text:gsub("", function (s) return s:gsub( "%p", {["&"] = "&", ["<"] = "<", [">"] = ">" } )