fix images in rss feed
- escape alt text - add "full image hidden" message if it is
This commit is contained in:
parent
5944a55020
commit
c088389889
1 changed files with 7 additions and 2 deletions
|
@ -87,16 +87,21 @@ makeItem root prefix nsfw path info@(Info {title}) = [b|
|
|||
Artist name (Just url) -> [b|<p>by <a href="$url">$name</a>|]
|
||||
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 _) -> "<p>(full image hidden; open to see)</p>"
|
||||
_ -> "" :: Text
|
||||
figure alt p = [b|
|
||||
<figure aria-describedby=mainimg>
|
||||
<a href="$link">
|
||||
<img id=mainimg src="$link/$p" alt="$alt" title="$alt">
|
||||
</a>
|
||||
</figure>
|
||||
$msg
|
||||
|]
|
||||
|
||||
makeDesc :: Desc -> Builder
|
||||
|
|
Loading…
Reference in a new issue