Skip to content

Commit 7404e8e

Browse files
Cr4xyacaodimaMachina
authored
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 <[email protected]> Co-authored-by: Dimitri POSTOLOV <[email protected]>
1 parent 2e832f2 commit 7404e8e

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.changeset/pink-singers-glow.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@graphiql/react": minor
3+
"graphiql": minor
4+
---
5+
6+
Add webp support to graphiql results image-preview

packages/graphiql-react/src/editor/components/image-preview.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ function tokenToURL(token: Token) {
8484
}
8585

8686
function isImageURL(url: URL) {
87-
return /(bmp|gif|jpeg|jpg|png|svg)$/.test(url.pathname);
87+
return /\.(bmp|gif|jpe?g|png|svg|webp)$/.test(url.pathname);
8888
}

resources/custom-words.txt

+1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ vitejs
219219
vitest
220220
vizag
221221
vsix
222+
webp
222223
websockets
223224
wgutils
224225
wincent

0 commit comments

Comments
 (0)