From ea47cb6b5713b146bb8980bafc3be03ce63e932e Mon Sep 17 00:00:00 2001 From: isaaktsalicoglou <76704620+isaaktsalicoglou@users.noreply.github.com> Date: Mon, 28 Dec 2020 21:24:26 +0200 Subject: [PATCH] Update featherlight.js Extended the regex of image extensions in contentFilters with "webp" so that featherlight can also work with WebP images. This change makes it work on e.g. on a Grav CMS installation with grav-featherlight-plugin and WebP images. --- src/featherlight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/featherlight.js b/src/featherlight.js index 30722dc..b18d946 100644 --- a/src/featherlight.js +++ b/src/featherlight.js @@ -392,7 +392,7 @@ process: function(elem) { return this.persist !== false ? $(elem) : $(elem).clone(true); } }, image: { - regex: /\.(png|jpg|jpeg|gif|tiff?|bmp|svg)(\?\S*)?$/i, + regex: /\.(png|jpg|jpeg|gif|tiff?|bmp|svg|webp)(\?\S*)?$/i, process: function(url) { var self = this, deferred = $.Deferred(),