fix(linky): encode all double quotes when serializing email addresses

When encoding a URL or an email address, then escape all double quotes

Closes #10090
This commit is contained in:
Lucas Galfaso
2014-11-26 20:48:49 +01:00
parent 08cd5c19c7
commit 2ec8d1ffc0
2 changed files with 2 additions and 2 deletions

View File

@@ -142,7 +142,7 @@ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
'" ');
}
html.push('href="',
url.replace('"', '"'),
url.replace(/"/g, '"'),
'">');
addText(text);
html.push('</a>');

View File

@@ -30,7 +30,7 @@ describe('linky', function() {
});
it('should handle quotes in the email', function() {
expect(linky('foo@"bar.com')).toEqual('<a href="mailto:foo@&#34;bar.com">foo@&#34;bar.com</a>');
expect(linky('foo@"bar".com')).toEqual('<a href="mailto:foo@&#34;bar&#34;.com">foo@&#34;bar&#34;.com</a>');
});
it('should handle target:', function() {