From 28a5d8bcfec37ccdfea3ec910e7a5268fc2f7b51 Mon Sep 17 00:00:00 2001 From: Matthieu Rakotojaona Date: Fri, 17 Feb 2023 18:13:05 +0100 Subject: [PATCH] Take longer content between description and content Sometimes the content and the description are both filled, but with garbage data. Take the one that is longest because it "feels" like a better content --- cmd/feed2mdir/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/feed2mdir/main.go b/cmd/feed2mdir/main.go index f15826d..1ea7f92 100644 --- a/cmd/feed2mdir/main.go +++ b/cmd/feed2mdir/main.go @@ -85,10 +85,10 @@ func main() { latest = when } var what string - if len(item.Content) == 0 { - what = item.Description - } else { + if len(item.Content) > len(item.Description) { what = item.Content + } else { + what = item.Description } what = strings.TrimPrefix(what, "") -- 2.44.0