# HG changeset patch # User Kim Alvefur # Date 1673363101 -3600 # Node ID 35085e0d52ad2b353fbdac768e06d397f9a5eff2 # Parent e0d0ef56409594965383a19bf63a0c35e0599d1b mod_pubsub_summary: Trim preceding and trailing whitespace from title To improve formatting of titles encoded like Lorem Ipsum diff -r e0d0ef564095 -r 35085e0d52ad mod_pubsub_summary/mod_pubsub_summary.lua --- a/mod_pubsub_summary/mod_pubsub_summary.lua Sun Jan 08 17:54:11 2023 +0100 +++ b/mod_pubsub_summary/mod_pubsub_summary.lua Tue Jan 10 16:05:01 2023 +0100 @@ -4,6 +4,7 @@ module:hook("pubsub-summary/http://www.w3.org/2005/Atom", function (event) local payload = event.payload; local title = payload:get_child_text("title"); + if title then title = title:gsub("^%s+", ""):gsub("%s+$", ""); end -- Note: This prefers content over summary, it was made for a news feed where -- the interesting stuff was in the content and the summary was .. meh. local content_tag = payload:get_child("content") or payload:get_child("summary");