Skip to content

Commit a65603b

Browse files
committed
Bypass Markdown, so that emoji-only messages still invoke Emojify.
1 parent 73daa8b commit a65603b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ts/components/conversation/message/message-content/MessageBody.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ export const MessageBody = (props: Props) => {
200200
);
201201
}
202202

203-
if (window.getSettingValue('message-formatting')) {
203+
const onlyEmoji = text.match(/^((\ud83c[\udde6-\uddff]){2}|([\#\*0-9]\u20e3)|(\u00a9|\u00ae|[\u2000-\u3300]|[\u/d83c-\ud83e][\ud000-\udfff])((\ud83c[\udffb-\udfff])?(\ud83e[\uddb0-\uddb3])?(\ufe0f?\u200d([\u2000-\u3300]|[\ud83c-\ud83e][\ud000-\udfff])\ufe0f?)?)*)$/)
204+
205+
if (window.getSettingValue('message-formatting') && !onlyEmoji) {
204206
/* Resolve mentioned ids to user names and mark them up in bold */
205207
const mention = new RegExp(`@${PubKey.regexForPubkeys}`, 'g');
206208
const textWithMentions = text.trim().replace(mention,

0 commit comments

Comments
 (0)