From 248e508c7ee382ebb61c8386247d70757d2b35a4 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 14 Dec 2020 18:47:11 +0100 Subject: [PATCH] Deal with hr/br in a single gsub call (#6995) --- frontend/ui/opdsparser.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/ui/opdsparser.lua b/frontend/ui/opdsparser.lua index 91ba4cfa8..d92bae9a9 100644 --- a/frontend/ui/opdsparser.lua +++ b/frontend/ui/opdsparser.lua @@ -81,8 +81,7 @@ function OPDSParser:parse(text) -- 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("
", "
") + text = text:gsub("<([bh]r)>", "<%1 />") -- 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", {["&"] = "&", ["<"] = "<", [">"] = ">" } )