Fix ensureProtocol not trimming whitespace
This commit is contained in:
parent
4af445d242
commit
f05f3deb17
|
@ -1,4 +1,5 @@
|
||||||
export function ensureProtocol (value) {
|
export function ensureProtocol (value) {
|
||||||
|
value = value.trim()
|
||||||
if (!/^([a-z0-9]+:\/\/|mailto:)/.test(value)) {
|
if (!/^([a-z0-9]+:\/\/|mailto:)/.test(value)) {
|
||||||
value = 'http://' + value
|
value = 'http://' + value
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue