]> git.plutz.net Git - shellwiki/commitdiff
escape gallery URLs
authorPaul Hänsch <paul@plutz.net>
Sun, 3 Sep 2023 13:16:37 +0000 (15:16 +0200)
committerPaul Hänsch <paul@plutz.net>
Sun, 3 Sep 2023 13:16:37 +0000 (15:16 +0200)
macros/gallery

index ebaeb84ce5dd2651d0504c56e179a8aa93d53ab9..edc6a39d1f2240198fb924f728c2940eb9138c82 100755 (executable)
@@ -33,12 +33,14 @@ done \
 | while read attachment; do
   case $attachment in
     */*)
-      printf '<a href="%s"><img src="%s"></a>' \
-             "${attachment%/*}/[attachment]/${attachment##*/}" "${attachment}"
+      printf '<a href="%s"><img alt="" src="%s"></a>' \
+             "$(URL "${attachment%/*}/[attachment]/${attachment##*/}")" \
+             "$(URL "${attachment}")"
       ;;
     *)
-      printf '<a href="%s"><img src="%s"></a>' \
-             "[attachment]/${attachment}" "${attachment}"
+      printf '<a href="%s"><img alt="" src="%s"></a>' \
+             "$(URL "[attachment]/${attachment}")" \
+             "$(URL "${attachment}")"
       ;;
   esac
 done