(fix) imprived the gravatar directive to extract email address between < >

This commit is contained in:
Ludovic Marcotte 2015-08-06 16:18:10 -04:00
parent 33d0f30d97
commit b5ca697b43

View file

@ -12,10 +12,16 @@
*/ */
function Gravatar() { function Gravatar() {
return function(email, size) { return function(email, size) {
var hash, s = size; var x, y, hash, s = size;
if (!email) { if (!email) {
return ''; return '';
} }
x = email.indexOf('<');
if (x >= 0) {
y = email.indexOf('>', x);
if (y > x)
email = email.substring(x+1,y);
}
if (!size) { if (!size) {
s = 48; // default to 48 pixels s = 48; // default to 48 pixels
} }