mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 18:43:41 -05:00
web/emoji: use custom emoji description as img title
This commit is contained in:
parent
fa004a639e
commit
fdec12a7a3
1 changed files with 2 additions and 1 deletions
|
@ -104,7 +104,8 @@ function filterAndSort(
|
||||||
|
|
||||||
export function emojiToMarkdown(emoji: PartialEmoji): string {
|
export function emojiToMarkdown(emoji: PartialEmoji): string {
|
||||||
if (emoji.u.startsWith("mxc://")) {
|
if (emoji.u.startsWith("mxc://")) {
|
||||||
return `<img data-mx-emoticon height="32" src="${emoji.u}" alt=":${emoji.n}:" title=":${emoji.n}:"/>`
|
const title = emoji.t && emoji.t !== emoji.n ? emoji.t : `:${emoji.n}:`
|
||||||
|
return `<img data-mx-emoticon height="32" src="${emoji.u}" alt=":${emoji.n}:" title="${title}"/>`
|
||||||
}
|
}
|
||||||
return emoji.u
|
return emoji.u
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue