# HG changeset patch # User Kim Alvefur # Date 1612969514 -3600 # Node ID 07529dba102d277625e40164f10a618cc6c1fa85 # Parent a620bf249e63bc6b6f54a198854896e157ab5176 mod_pubsub_summary: Include multiple links (e.g. podcast media) diff -r a620bf249e63 -r 07529dba102d mod_pubsub_summary/mod_pubsub_summary.lua --- a/mod_pubsub_summary/mod_pubsub_summary.lua Wed Feb 10 16:04:17 2021 +0100 +++ b/mod_pubsub_summary/mod_pubsub_summary.lua Wed Feb 10 16:05:14 2021 +0100 @@ -30,15 +30,17 @@ nbsp = utf8 and utf8.char(0xa0) or " "; }); end - local link = payload:get_child("link"); local summary; if title and content then summary = title .. "\n\n" .. content; elseif title or content then summary = content or title; end - if link and link.attr.href and link.attr.href ~= content then - summary = (summary and summary .. "\n" or "") .. link.attr.href; + for link in payload:childtags("link") do + if link and link.attr.href and link.attr.href ~= content then + summary = (summary and summary .. "\n" or "") .. link.attr.href; + if link.attr.rel then summary = summary .. " [" .. link.attr.rel .. "]" end + end end return summary; end, 1);