mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-06-17 02:41:49 +08:00
@@ -104,7 +104,7 @@
|
||||
*/
|
||||
angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
|
||||
var LINKY_URL_REGEXP =
|
||||
/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>]/,
|
||||
/((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"]/,
|
||||
MAILTO_REGEXP = /^mailto:/;
|
||||
|
||||
return function(text, target) {
|
||||
|
||||
@@ -25,6 +25,8 @@ describe('linky', function() {
|
||||
toEqual('<a href="mailto:me@example.com">me@example.com</a>');
|
||||
expect(linky("send email to me@example.com, but")).
|
||||
toEqual('send email to <a href="mailto:me@example.com">me@example.com</a>, but');
|
||||
expect(linky("my email is \"me@example.com\"")).
|
||||
toEqual('my email is "<a href="mailto:me@example.com">me@example.com</a>"');
|
||||
});
|
||||
|
||||
it('should handle target:', function() {
|
||||
|
||||
Reference in New Issue
Block a user