diff --git a/src/shortcodes/gallery.js b/src/shortcodes/gallery.js index 14dbd6f..d9db76e 100644 --- a/src/shortcodes/gallery.js +++ b/src/shortcodes/gallery.js @@ -32,10 +32,11 @@ const getLargestImage = (imageMetadata, format) => { const imgHtmlString = (image, imageMetadata) => { const largestUnoptimizedImg = getLargestImage(imageMetadata, "jpeg"); + const imagePath = image.split('/') const imgAttributes = stringifyAttributes({ src: largestUnoptimizedImg.url, - alt: image.split('/').at(-1), + alt: imagePath[imagePath.length-1], loading: 'lazy', decoding: 'async', });