Allow option to not include title on emoji images.
This commit is contained in:
parent
ecb1078343
commit
1cf0401e26
|
@ -29,8 +29,8 @@ function emojiOptions() {
|
|||
return { getURL: Discourse.getURLWithCDN, emojiSet: siteSettings.emoji_set };
|
||||
}
|
||||
|
||||
export function emojiUnescape(string) {
|
||||
const opts = emojiOptions();
|
||||
export function emojiUnescape(string, options) {
|
||||
const opts = _.extend(emojiOptions(), options || {});
|
||||
return opts ? performEmojiUnescape(string, opts) : string;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ export function performEmojiUnescape(string, opts) {
|
|||
const classes = isCustomEmoji(emojiVal, opts) ? "emoji emoji-custom" : "emoji";
|
||||
|
||||
return url && (isEmoticon || hasEndingColon) ?
|
||||
`<img src='${url}' title='${emojiVal}' alt='${emojiVal}' class='${classes}'>` : m;
|
||||
`<img src='${url}' ${opts.skipTitle ? '' : `title='${emojiVal}'`} alt='${emojiVal}' class='${classes}'>` : m;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue