FIX: support for more than 1 emojis in the title
This commit is contained in:
parent
76a14cd279
commit
357d4e3dd3
|
@ -9,7 +9,7 @@ const Topic = RestModel.extend({
|
|||
let title = this.get("fancy_title");
|
||||
|
||||
if (Discourse.SiteSettings.enable_emoji && title.indexOf(":") >= 0) {
|
||||
title = title.replace(/:\S+:?/, function(m) {
|
||||
title = title.replace(/:\S+:?/g, function(m) {
|
||||
const emoji = Discourse.Emoji.translations[m] ? Discourse.Emoji.translations[m] : m.slice(1, m.length - 1),
|
||||
url = Discourse.Emoji.urlFor(emoji);
|
||||
return url ? "<img src='" + url + "' title='" + emoji + "' alt='" + emoji + "' class='emoji'>" : m;
|
||||
|
|
Loading…
Reference in New Issue