|
|
@ -81,8 +81,7 @@ function OPDSParser:parse(text)
|
|
|
|
-- luxl is also particular about the syntax for self-closing, empty & orphaned tags...
|
|
|
|
-- luxl is also particular about the syntax for self-closing, empty & orphaned tags...
|
|
|
|
text = text:gsub("<(%l+)/>", "<%1 />")
|
|
|
|
text = text:gsub("<(%l+)/>", "<%1 />")
|
|
|
|
-- We also need to handle the slash-less variants for br & hr...
|
|
|
|
-- We also need to handle the slash-less variants for br & hr...
|
|
|
|
text = text:gsub("<br>", "<br />")
|
|
|
|
text = text:gsub("<([bh]r)>", "<%1 />")
|
|
|
|
text = text:gsub("<hr>", "<hr />")
|
|
|
|
|
|
|
|
-- Some OPDS catalogs wrap text in a CDATA section, remove it as it causes parsing problems
|
|
|
|
-- Some OPDS catalogs wrap text in a CDATA section, remove it as it causes parsing problems
|
|
|
|
text = text:gsub("<!%[CDATA%[(.-)%]%]>", function (s)
|
|
|
|
text = text:gsub("<!%[CDATA%[(.-)%]%]>", function (s)
|
|
|
|
return s:gsub( "%p", {["&"] = "&", ["<"] = "<", [">"] = ">" } )
|
|
|
|
return s:gsub( "%p", {["&"] = "&", ["<"] = "<", [">"] = ">" } )
|
|
|
|