From 1db0c1a3c8afaa24fde2ce9ee7afc85f567b4378 Mon Sep 17 00:00:00 2001 From: Carlos Fernandes Cunha Date: Thu, 5 Oct 2023 23:02:06 -0300 Subject: [PATCH] fix(gatsby): support multiple instances of same variable in gatsbyImage placeholderUrl --- .../src/polyfill-remote-file/placeholder-handler.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/gatsby-plugin-utils/src/polyfill-remote-file/placeholder-handler.ts b/packages/gatsby-plugin-utils/src/polyfill-remote-file/placeholder-handler.ts index c97cdd2863604..df769271ea23c 100644 --- a/packages/gatsby-plugin-utils/src/polyfill-remote-file/placeholder-handler.ts +++ b/packages/gatsby-plugin-utils/src/polyfill-remote-file/placeholder-handler.ts @@ -273,7 +273,7 @@ function generatePlaceholderUrl({ const aspectRatio = originalWidth / originalHeight return url - .replace(`%width%`, String(width)) - .replace(`%height%`, Math.floor(width / aspectRatio).toString()) - .replace(`%quality%`, String(quality)) + .replaceAll(`%width%`, String(width)) + .replaceAll(`%height%`, Math.floor(width / aspectRatio).toString()) + .replaceAll(`%quality%`, String(quality)) }