1
0
mirror of https://github.com/zedeus/nitter.git synced 2026-04-15 10:12:09 -04:00

Support image alt text

Fixes #559
This commit is contained in:
Zed
2026-02-10 22:42:06 +01:00
parent 40b1ba4e4e
commit 1c06a67afd
9 changed files with 60 additions and 19 deletions

View File

@@ -50,10 +50,12 @@ proc renderAlbum(tweet: Tweet): VNode =
for photo in photos:
tdiv(class="attachment image"):
let
named = "name=" in photo
small = if named: photo else: photo & smallWebp
a(href=getOrigPicUrl(photo), class="still-image", target="_blank"):
genImg(small)
named = "name=" in photo.url
small = if named: photo.url else: photo.url & smallWebp
a(href=getOrigPicUrl(photo.url), class="still-image", target="_blank"):
genImg(small, alt=photo.altText)
if photo.altText.len > 0:
p(class="alt-text"): text "ALT " & photo.altText
proc isPlaybackEnabled(prefs: Prefs; playbackType: VideoType): bool =
case playbackType