Skip to content

Commit a7e721e

Browse files
authored
feat(image): [image] The image component supports base64 in svg format (#2858)
1 parent 7b3e76e commit a7e721e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/renderless/src/image/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export const mounted =
185185
}
186186

187187
export const filterImageUrl = (props) => () => {
188-
const isBase64 = /^data:(image|application)\/(png|jpg|jpeg|gif|octet-stream);base64,([a-zA-Z0-9+/]+={0,2})/
188+
const isBase64 = /^data:(image|application)\/(png|jpg|jpeg|gif|octet-stream|svg\+xml);base64,([a-zA-Z0-9+/]+={0,2})/
189189

190190
return isBase64.test(props.src) ? props.src : xss.filterUrl(props.src)
191191
}

0 commit comments

Comments
 (0)