From c088389889cba7a43d25c4398c52a0eb5600f574 Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Mon, 21 Oct 2024 14:38:35 +0200 Subject: [PATCH] fix images in rss feed - escape alt text - add "full image hidden" message if it is --- make-pages/RSS.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/make-pages/RSS.hs b/make-pages/RSS.hs index c20343f..ee40bdc 100644 --- a/make-pages/RSS.hs +++ b/make-pages/RSS.hs @@ -87,16 +87,21 @@ makeItem root prefix nsfw path info@(Info {title}) = [b| Artist name (Just url) -> [b|

by $name|] desc = makeDesc $ descFor nsfw info - image = case previewImage info of - Just (PFull img) -> figure img.desc $ pageFile img + preview = previewImage info + image = case preview of + Just (PFull img) -> figure (escAttr img.desc) $ pageFile img Just (PThumb th) -> figure "full image hidden" $ thumbFile th Nothing -> "" + msg = case preview of + Just (PThumb _) -> "

(full image hidden; open to see)

" + _ -> "" :: Text figure alt p = [b|
$alt
+ $msg |] makeDesc :: Desc -> Builder