mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-13 08:59:54 +08:00
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:
@@ -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>');
|
||||
|
||||
@@ -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@"bar.com">foo@"bar.com</a>');
|
||||
expect(linky('foo@"bar".com')).toEqual('<a href="mailto:foo@"bar".com">foo@"bar".com</a>');
|
||||
});
|
||||
|
||||
it('should handle target:', function() {
|
||||
|
||||
Reference in New Issue
Block a user