Commit 326386db authored by 李维's avatar 李维

更新图片正则

parent e0ad2501
...@@ -321,7 +321,7 @@ export default class Cartoon { ...@@ -321,7 +321,7 @@ export default class Cartoon {
} }
mountImageToNode(url, node, width, height, fillType) { mountImageToNode(url, node, width, height, fillType) {
var urlreg=/^(?=^.{3,255}$)(http(s)?:\/\/)?(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/\w+\.\w+)*([\?&]\w+=\w*)*$/ var urlreg=/(?:(http|https|ftp):\/\/)?((?:[\w-]+\.)+[a-z0-9]+)((?:\/[^/?#]*)+)?(\?[^#]+)?(#.+)?$/
if(urlreg.test(url)) { if(urlreg.test(url)) {
return this.mountRemoteImageToNode(url, node, width, height, fillType) return this.mountRemoteImageToNode(url, node, width, height, fillType)
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment