From a77c3d4d9b6d550419916275bb2ed9409caa59fd Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 10 Apr 2019 18:00:04 +0100 Subject: [PATCH] Prevent user pills containing only emoji from embiggening --- src/HtmlUtils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 3315e86e71..3e3138fe66 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -516,7 +516,10 @@ export function bodyToHtml(content, highlights, opts={}) { contentBodyTrimmed = contentBodyTrimmed.replace(ZWJ_REGEX, ''); const match = EMOJI_REGEX.exec(contentBodyTrimmed); - emojiBody = match && match[0] && match[0].length === contentBodyTrimmed.length; + emojiBody = match && match[0] && match[0].length === contentBodyTrimmed.length + // Prevent user pills expanding for users with only emoji in + // their username + && content.formatted_body == undefined; } const className = classNames({