From b55be6eb78a3df22b84d57bdf601021798ec2951 Mon Sep 17 00:00:00 2001 From: Jalil Arfaoui Date: Sun, 23 Oct 2022 01:26:05 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Array.at()=20non=20support=C3=A9=20par?= =?UTF-8?q?=20Node=2014?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shortcodes/gallery.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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', });