Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 22475b1

Browse files
committed
Minor tweak
1 parent a7a5d41 commit 22475b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ngSanitize/filter/linky.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
118118
// We can not end in these as they are sometimes found at the end of the sentence
119119
url = match[0];
120120
// if we did not match ftp/http/www/mailto then assume mailto
121-
if (match[2] == match[4]) {
122-
url = (url.substring(0, 4) === 'www.') ? ('http://' + url) : (url = 'mailto:' + url);
121+
if (!match[2] && !match[4]) {
122+
url = (match[3] ? 'http://' : 'mailto:') + url;
123123
}
124124
i = match.index;
125125
addText(raw.substr(0, i));

0 commit comments

Comments
 (0)