diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-23 12:50:15 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-23 12:50:15 +0100 |
commit | f88f8fcb7f7451babc8aa20ecc0dad06dd27e1ed (patch) | |
tree | cb53495565d3a5757b6efc44c179b6d95b244721 /js/vendor/angular-sanitize/angular-sanitize.js | |
parent | 367a4eed30e9fa77a2aa5d7924f041e967f8567d (diff) |
update jasmine, karma and angular
Diffstat (limited to 'js/vendor/angular-sanitize/angular-sanitize.js')
-rw-r--r-- | js/vendor/angular-sanitize/angular-sanitize.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/js/vendor/angular-sanitize/angular-sanitize.js b/js/vendor/angular-sanitize/angular-sanitize.js index 315b98bd2..8b5f4e703 100644 --- a/js/vendor/angular-sanitize/angular-sanitize.js +++ b/js/vendor/angular-sanitize/angular-sanitize.js @@ -1,5 +1,5 @@ /** - * @license AngularJS v1.3.5 + * @license AngularJS v1.3.8 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ @@ -628,7 +628,7 @@ angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider); */ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) { var LINKY_URL_REGEXP = - /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/, + /((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"”’]/, MAILTO_REGEXP = /^mailto:/; return function(text, target) { @@ -641,8 +641,10 @@ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) { while ((match = raw.match(LINKY_URL_REGEXP))) { // We can not end in these as they are sometimes found at the end of the sentence url = match[0]; - // if we did not match ftp/http/mailto then assume mailto - if (match[2] == match[3]) url = 'mailto:' + url; + // if we did not match ftp/http/www/mailto then assume mailto + if (!match[2] && !match[4]) { + url = (match[3] ? 'http://' : 'mailto:') + url; + } i = match.index; addText(raw.substr(0, i)); addLink(url, match[0].replace(MAILTO_REGEXP, '')); |