# HG changeset patch # User Kim Alvefur # Date 1615992732 -3600 # Node ID ade2064160e34286dbc615d79415c3a6cd6d8657 # Parent b88f05c878ac310aa3c5782097e462b6f52c711b mod_pubsub_summary: Fix to not strip inline links Links were turned into `label ` and then a later pass removed the `` part leaving only the label. This should avoid that. Escaping is hard. diff -r b88f05c878ac -r ade2064160e3 mod_pubsub_summary/mod_pubsub_summary.lua --- a/mod_pubsub_summary/mod_pubsub_summary.lua Sun Mar 14 23:31:32 2021 +0100 +++ b/mod_pubsub_summary/mod_pubsub_summary.lua Wed Mar 17 15:52:12 2021 +0100 @@ -11,7 +11,7 @@ if content and content_tag.attr.type == "html" then content = content:gsub("\n*]*>\n*(.-)\n*

\n*", "%1\n\n"); content = content:gsub("
  • (.-)
  • \n", "* %1\n"); - content = content:gsub("]*href=[\"'](.-)[\"'][^>]*>(.-)", "%2 <%1>"); + content = content:gsub("]*href=[\"'](.-)[\"'][^>]*>(.-)", "\1%1\2%2\3"); content = content:gsub("(.-)", "*%1*"); content = content:gsub("(.-)", "*%1*"); content = content:gsub("(.-)", "*%1*"); @@ -19,6 +19,7 @@ content = content:gsub("]*src=[\"'](.-)[\"'][^>]*>", " %1 "); -- TODO alt= would have been nice to grab content = content:gsub("]*>", "\n"); content = content:gsub("<[^>]+>", ""); + content = content:gsub("\1(.-)\2(.-)\3", "%2 <%1>"); content = content:gsub("^%s*", ""):gsub("%s*$", ""); content = content:gsub("\n\n\n+", "\n\n"); content = content:gsub("&(%w+);", {