From 72f4d3914bd4d48ef34e3b80d83800df31f7a077 Mon Sep 17 00:00:00 2001 From: Martin Meszaros Date: Fri, 11 Feb 2022 20:01:09 +0100 Subject: [PATCH 1/2] Format Feed links as Markdown links --- server/plugin.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/plugin.go b/server/plugin.go index 677e48f..119ae6d 100644 --- a/server/plugin.go +++ b/server/plugin.go @@ -165,7 +165,8 @@ func (p *RSSFeedPlugin) processRSSV2Subscription(subscription *Subscription) err } if config.ShowRSSLink { - post = post + strings.TrimSpace(item.Link) + "\n" + var link = strings.TrimSpace(item.Link) + post = post + "[" + link + "]" + "(" + link + ")" + "\n" } if config.ShowDescription { post = post + html2md.Convert(item.Description) + "\n" @@ -223,7 +224,8 @@ func (p *RSSFeedPlugin) processAtomSubscription(subscription *Subscription) erro if config.ShowAtomLink { for _, link := range item.Link { if link.Rel == "alternate" { - post = post + strings.TrimSpace(link.Href) + "\n" + var link = strings.TrimSpace(link.Href) + post = post + "[" + link + "]" + "(" + link + ")" + "\n" } } } From 43af3d4c766c4bf555229d2cfac0da31af59b165 Mon Sep 17 00:00:00 2001 From: Martin Meszaros Date: Fri, 18 Feb 2022 17:24:02 +0100 Subject: [PATCH 2/2] Surround target with angle brackets (fixes parsing on mobile apps) --- server/plugin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/plugin.go b/server/plugin.go index 119ae6d..34ea9ab 100644 --- a/server/plugin.go +++ b/server/plugin.go @@ -166,7 +166,7 @@ func (p *RSSFeedPlugin) processRSSV2Subscription(subscription *Subscription) err if config.ShowRSSLink { var link = strings.TrimSpace(item.Link) - post = post + "[" + link + "]" + "(" + link + ")" + "\n" + post = post + "[" + link + "]" + "(<" + link + ">)" + "\n" } if config.ShowDescription { post = post + html2md.Convert(item.Description) + "\n" @@ -225,7 +225,7 @@ func (p *RSSFeedPlugin) processAtomSubscription(subscription *Subscription) erro for _, link := range item.Link { if link.Rel == "alternate" { var link = strings.TrimSpace(link.Href) - post = post + "[" + link + "]" + "(" + link + ")" + "\n" + post = post + "[" + link + "]" + "(<" + link + ">)" + "\n" } } }