diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 3315e86e71..d9d8bac93b 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -516,7 +516,11 @@ 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 + || !content.formatted_body.includes("https://matrix.to/")); } const className = classNames({