From 48bac198206fb02e831f1ed982976e8115f076b4 Mon Sep 17 00:00:00 2001 From: tdro Date: Mon, 10 Oct 2022 17:34:54 -0400 Subject: themes/default/layouts/partials/generate-feeds: Plainify to html first Seems to be better at filtering out html. --- .../default/layouts/partials/generate-feeds.html | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/themes/default/layouts/partials/generate-feeds.html b/themes/default/layouts/partials/generate-feeds.html index aec232f..cb53e17 100644 --- a/themes/default/layouts/partials/generate-feeds.html +++ b/themes/default/layouts/partials/generate-feeds.html @@ -133,7 +133,7 @@ {{- end -}} - {{- $sourceDomain := ($sourceLink | plainify | htmlUnescape | urls.Parse).Host -}} + {{- $sourceDomain := ($sourceLink | plainify | html | htmlUnescape | urls.Parse).Host -}} {{- /* Replace invalid time zones. */ -}} {{- $date = replaceRE "G[0-9]+T" "UTC" $date -}} @@ -155,23 +155,23 @@ {{- $feeds = $feeds | append (dict - "FeedContent" ($content | plainify | htmlUnescape) - "FeedContentShort" (delimit (first 2 (split ($content | plainify | htmlUnescape) "\n")) " " | truncate 250) - "FeedDate" ($date | plainify | htmlUnescape | time.Format "January 2, 2006") - "FeedDateTime" ($date | plainify | htmlUnescape | time.Format "2006-01-02T15:04:05Z") - "FeedDateTitle" ($date | plainify | htmlUnescape | time.Format "Monday, January 2 2006 at 15:04:05 MST") - "FeedDescription" ($description | plainify | htmlUnescape) - "FeedDescriptionShort" (delimit (first 2 (split ($description | plainify | htmlUnescape) "\n")) " " | truncate 250) - "FeedEnclosure" ($enclosure | plainify | htmlUnescape) - "FeedImageLink" ($imageLink | plainify | htmlUnescape) - "FeedLink" ($link | plainify | htmlUnescape) - "FeedName" (delimit ((delimit (first 2 (split ($sourceTitle | plainify | htmlUnescape) " ")) " ") | findRE "^([^.|?|!|\n|\"|]+)") " " | replaceRE "[^a-zA-Z ]" "") - "FeedSourceDescription" ($sourceDescription | plainify | htmlUnescape) - "FeedSourceDomain" ($sourceDomain | plainify | htmlUnescape) - "FeedSourceLink" ($sourceLink | plainify | htmlUnescape) - "FeedSourceHome" ($sourceHome | plainify | htmlUnescape) - "FeedSourceTitle" ($sourceTitle | plainify | htmlUnescape) - "FeedTitle" ($title | plainify | htmlUnescape) + "FeedContent" ($content | plainify | html | htmlUnescape) + "FeedContentShort" (delimit (first 2 (split ($content | plainify | html | htmlUnescape) "\n")) " " | truncate 250) + "FeedDate" ($date | plainify | html | htmlUnescape | time.Format "January 2, 2006") + "FeedDateTime" ($date | plainify | html | htmlUnescape | time.Format "2006-01-02T15:04:05Z") + "FeedDateTitle" ($date | plainify | html | htmlUnescape | time.Format "Monday, January 2 2006 at 15:04:05 MST") + "FeedDescription" ($description | plainify | html | htmlUnescape) + "FeedDescriptionShort" (delimit (first 2 (split ($description | plainify | html | htmlUnescape) "\n")) " " | truncate 250) + "FeedEnclosure" ($enclosure | plainify | html | htmlUnescape) + "FeedImageLink" ($imageLink | plainify | html | htmlUnescape) + "FeedLink" ($link | plainify | html | htmlUnescape) + "FeedName" (delimit ((delimit (first 2 (split ($sourceTitle | plainify | html | htmlUnescape) " ")) " ") | findRE "^([^.|?|!|\n|\"|]+)") " " | replaceRE "[^a-zA-Z ]" "") + "FeedSourceDescription" ($sourceDescription | plainify | html | htmlUnescape) + "FeedSourceDomain" ($sourceDomain | plainify | html | htmlUnescape) + "FeedSourceLink" ($sourceLink | plainify | html | htmlUnescape) + "FeedSourceHome" ($sourceHome | plainify | html | htmlUnescape) + "FeedSourceTitle" ($sourceTitle | plainify | html | htmlUnescape) + "FeedTitle" ($title | plainify | html | htmlUnescape) ) -}} -- cgit v1.2.3