Commit 523b0892 authored by liujiaxin's avatar liujiaxin

fix: change url regex

parent c4caa878
...@@ -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=/^(?=^.{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*)*/
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