From 7404e8e6c62b06107f452142493297ec70f1649c Mon Sep 17 00:00:00 2001 From: Cr4xy Date: Wed, 14 Aug 2024 19:28:29 +0200 Subject: [PATCH] Add webp to image-preview (#3532) * Add webp to image-preview * Create pink-singers-glow.md add changeset * Update packages/graphiql-react/src/editor/components/image-preview.tsx * Update custom-words.txt * Update .changeset/pink-singers-glow.md * Update packages/graphiql-react/src/editor/components/image-preview.tsx --------- Co-authored-by: Rikki Schulte Co-authored-by: Dimitri POSTOLOV --- .changeset/pink-singers-glow.md | 6 ++++++ .../graphiql-react/src/editor/components/image-preview.tsx | 2 +- resources/custom-words.txt | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/pink-singers-glow.md diff --git a/.changeset/pink-singers-glow.md b/.changeset/pink-singers-glow.md new file mode 100644 index 00000000000..437ed778636 --- /dev/null +++ b/.changeset/pink-singers-glow.md @@ -0,0 +1,6 @@ +--- +"@graphiql/react": minor +"graphiql": minor +--- + +Add webp support to graphiql results image-preview diff --git a/packages/graphiql-react/src/editor/components/image-preview.tsx b/packages/graphiql-react/src/editor/components/image-preview.tsx index b330f7bb01a..4a2b65dfc16 100644 --- a/packages/graphiql-react/src/editor/components/image-preview.tsx +++ b/packages/graphiql-react/src/editor/components/image-preview.tsx @@ -84,5 +84,5 @@ function tokenToURL(token: Token) { } function isImageURL(url: URL) { - return /(bmp|gif|jpeg|jpg|png|svg)$/.test(url.pathname); + return /\.(bmp|gif|jpe?g|png|svg|webp)$/.test(url.pathname); } diff --git a/resources/custom-words.txt b/resources/custom-words.txt index a1a3f38758d..56c382a0aa6 100644 --- a/resources/custom-words.txt +++ b/resources/custom-words.txt @@ -219,6 +219,7 @@ vitejs vitest vizag vsix +webp websockets wgutils wincent