Comparison

mod_pubsub_summary/mod_pubsub_summary.lua @ 5129:cde38b7de04a

mod_pubsub_summary: Hide link relation when value is "alternate" Because this is usually the main URL for the post
author Kim Alvefur <zash@zash.se>
date Sat, 07 Jan 2023 17:15:47 +0100
parent 4609:fcfe691d6322
child 5131:82e7251d4f52
comparison
equal deleted inserted replaced
5128:7cc0f68b8715 5129:cde38b7de04a
38 summary = content or title; 38 summary = content or title;
39 end 39 end
40 for link in payload:childtags("link") do 40 for link in payload:childtags("link") do
41 if link and link.attr.href and link.attr.href ~= content then 41 if link and link.attr.href and link.attr.href ~= content then
42 summary = (summary and summary .. "\n" or "") .. link.attr.href; 42 summary = (summary and summary .. "\n" or "") .. link.attr.href;
43 if link.attr.rel then summary = summary .. " [" .. link.attr.rel .. "]" end 43 if link.attr.rel and link.attr.rel ~= "alternate" then summary = summary .. " [" .. link.attr.rel .. "]" end
44 end 44 end
45 end 45 end
46 return summary; 46 return summary;
47 end, 1); 47 end, 1);