mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
perf: 调整粘贴图片地址正则
This commit is contained in:
parent
68c967c39a
commit
b09b3559df
@ -19,7 +19,9 @@ interface PasteTextClipboardDataOptions {
|
||||
* !!!必须确保图片来源都是合法、可靠、可控、无访问限制的
|
||||
*/
|
||||
const isValidImgURL = (url: string) => {
|
||||
return /^https:\/\/pptist.cn(\/[\w-./?%&=]*)?\.(jpg|jpeg|png|svg|webp)(\?.*)?$/i.test(url)
|
||||
const pexels = /^https?:\/\/(?:[a-zA-Z0-9-]+\.)*pexels\.com\/[^\s]+\.(?:jpg|jpeg|png|svg|webp)(?:\?.*)?$/i.test(url)
|
||||
const pptist = /^https?:\/\/(?:[a-zA-Z0-9-]+\.)*pptist\.cn\/[^\s]+\.(?:jpg|jpeg|png|svg|webp)(?:\?.*)?$/i.test(url)
|
||||
return pexels || pptist
|
||||
}
|
||||
|
||||
export default () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user