fix: output span in buildAvatar helper instead of div

In not-so-rare circumstances, the avatar generated is wrapped in
an anchor so that when clicked, it goes to the user profile.

Unfortunately, html 4 spec doesn't like block level elements
inside anchors (since an anchor is an inline element), and even
though we define html5 doctype, browsers still reorder the div
and anchor, beats me as to why.

So I can trick the browser by using a span. The css already styles
it as inline-block so no further fixes are required.
v1.18.x
Julian Lam 6 years ago
parent 67b8cb8977
commit 69fae1a7e4

@ -313,7 +313,7 @@
}
styles.push('background-color: ' + userObj['icon:bgColor'] + ';');
return '<div ' + attributes.join(' ') + ' style="' + styles.join(' ') + '">' + userObj['icon:text'] + '</div>';
return '<span ' + attributes.join(' ') + ' style="' + styles.join(' ') + '">' + userObj['icon:text'] + '</span>';
}
function register() {

Loading…
Cancel
Save