From 1cf0401e26a0a9cfb4b86016e75ca70a5b8d6861 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 3 Jan 2017 11:07:55 +0800 Subject: [PATCH] Allow option to not include title on emoji images. --- app/assets/javascripts/discourse/lib/text.js.es6 | 4 ++-- app/assets/javascripts/pretty-text/emoji.js.es6 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/text.js.es6 b/app/assets/javascripts/discourse/lib/text.js.es6 index 56f460852f2..dc3c1cdf971 100644 --- a/app/assets/javascripts/discourse/lib/text.js.es6 +++ b/app/assets/javascripts/discourse/lib/text.js.es6 @@ -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; } diff --git a/app/assets/javascripts/pretty-text/emoji.js.es6 b/app/assets/javascripts/pretty-text/emoji.js.es6 index 67f047dc01d..3df9040a240 100644 --- a/app/assets/javascripts/pretty-text/emoji.js.es6 +++ b/app/assets/javascripts/pretty-text/emoji.js.es6 @@ -38,7 +38,7 @@ export function performEmojiUnescape(string, opts) { const classes = isCustomEmoji(emojiVal, opts) ? "emoji emoji-custom" : "emoji"; return url && (isEmoticon || hasEndingColon) ? - `${emojiVal}` : m; + `${emojiVal}` : m; }); }