Trim url before opening in browser
This commit is contained in:
parent
7402718e68
commit
27ad8f07c3
|
@ -112,7 +112,10 @@
|
||||||
(.catch (or on-error #())))))
|
(.catch (or on-error #())))))
|
||||||
|
|
||||||
(defn normalize-url [url]
|
(defn normalize-url [url]
|
||||||
(str (when (and (string? url) (not (re-find #"^[a-zA-Z-_]+:/" url))) "https://") url))
|
(str (when (and (string? url)
|
||||||
|
(not (re-find #"^[a-zA-Z-_]+:/" url)))
|
||||||
|
"https://")
|
||||||
|
((fnil string/trim "") url)))
|
||||||
|
|
||||||
(def normalize-and-decode-url (comp js/decodeURI normalize-url))
|
(def normalize-and-decode-url (comp js/decodeURI normalize-url))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue