Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit a9a3d31

Browse files
committed
feat: improve emoji-body detection
1 parent 6a133bc commit a9a3d31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/HtmlUtils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ module.exports = {
217217
}
218218

219219
EMOJI_REGEX.lastIndex = 0;
220-
let match = EMOJI_REGEX.exec(body);
221-
let emojiBody = match && match[0] && match[0].length === body.length;
220+
let contentBodyTrimmed = content.body.trim();
221+
let match = EMOJI_REGEX.exec(contentBodyTrimmed);
222+
let emojiBody = match && match[0] && match[0].length === contentBodyTrimmed.length;
222223

223224
let className = classNames('markdown-body', {
224225
'emoji-body': emojiBody,

0 commit comments

Comments
 (0)