mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
Added a better way of detecting when a url does not have a protocol specified
This commit is contained in:
parent
a120d78b7e
commit
c3a58f42e7
1 changed files with 1 additions and 1 deletions
|
@ -185,7 +185,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
|
|||
{
|
||||
if (href)
|
||||
{
|
||||
if(!~href.indexOf("http")) // if the url doesn't include http or https etc prefix it.
|
||||
if(!~href.indexOf("://") && !~href.indexOf("mailto:")) // if the url doesn't include a protocol prefix, assume http
|
||||
{
|
||||
href = "http://"+href;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue