Merge pull request #5517 from matrix-org/jryans/big-emoji-html

Look for emoji in the body that will be displayed
pull/21833/head
J. Ryan Stinnett 2020-12-21 16:07:58 +00:00 committed by GitHub
commit ee56560e33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -438,13 +438,14 @@ export function bodyToHtml(content: IContent, highlights: string[], opts: IOpts
delete sanitizeParams.textFilter; delete sanitizeParams.textFilter;
} }
const contentBody = isDisplayedWithHtml ? safeBody : strippedBody;
if (opts.returnString) { if (opts.returnString) {
return isDisplayedWithHtml ? safeBody : strippedBody; return contentBody;
} }
let emojiBody = false; let emojiBody = false;
if (!opts.disableBigEmoji && bodyHasEmoji) { if (!opts.disableBigEmoji && bodyHasEmoji) {
let contentBodyTrimmed = strippedBody !== undefined ? strippedBody.trim() : ''; let contentBodyTrimmed = contentBody !== undefined ? contentBody.trim() : '';
// Ignore spaces in body text. Emojis with spaces in between should // Ignore spaces in body text. Emojis with spaces in between should
// still be counted as purely emoji messages. // still be counted as purely emoji messages.