FIX: support for more than 1 emojis in the title

This commit is contained in:
Régis Hanol 2015-06-15 23:44:39 +02:00
parent 76a14cd279
commit 357d4e3dd3

View file

@ -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;