ssb: Use img title=, not alt= for more browser support.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 36m42s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 36m42s
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🦀",
|
||||
"previous": "&Eg9WyDY1CmakDJYw0+fk0PDW1EOW3gS/Np10dAJZM7c=.sha256"
|
||||
"previous": "&fAgPjWyRwHxcKiSV3T8OE7UyAUUgHE02YnA7e+sm3lo=.sha256"
|
||||
}
|
||||
|
@ -34,11 +34,10 @@ class TfUserElement extends LitElement {
|
||||
>😎</span
|
||||
>`;
|
||||
let name = this.users?.[this.id]?.name;
|
||||
let name_string = name ?? this.fallback_name ?? this.id;
|
||||
name = this.icon_only
|
||||
? undefined
|
||||
: html`<a target="_top" href=${'#' + this.id}
|
||||
>${name ?? this.fallback_name ?? this.id}</a
|
||||
>`;
|
||||
: html`<a target="_top" href=${'#' + this.id}>${name_string}</a>`;
|
||||
|
||||
if (user) {
|
||||
let image_link = user.image;
|
||||
@ -52,7 +51,7 @@ class TfUserElement extends LitElement {
|
||||
class=${'w3-theme-l4 ' + shape}
|
||||
style="width: 2em; height: 2em; vertical-align: middle; object-fit: cover"
|
||||
src="/${image_link}/view"
|
||||
alt=${name ?? this.fallback_name ?? this.id}
|
||||
title=${name_string + ' (' + this.id + ')'}
|
||||
/>`;
|
||||
}
|
||||
}
|
||||
|
@ -50,9 +50,9 @@ function image(node, entering) {
|
||||
'</div>'
|
||||
);
|
||||
if (this.options.safe && potentiallyUnsafe(node.destination)) {
|
||||
this.lit('<img src="" alt="');
|
||||
this.lit('<img src="" title="');
|
||||
} else {
|
||||
this.lit('<img src="' + this.esc(node.destination) + '" alt="');
|
||||
this.lit('<img src="' + this.esc(node.destination) + '" title="');
|
||||
}
|
||||
}
|
||||
this.disableTags += 1;
|
||||
|
Reference in New Issue
Block a user