Skip to content

Commit

Permalink
feat: improve emoji-body detection
Browse files Browse the repository at this point in the history
  • Loading branch information
aviraldg committed Jul 5, 2016
1 parent 6a133bc commit a9a3d31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/HtmlUtils.js
Expand Up @@ -217,8 +217,9 @@ module.exports = {
}

EMOJI_REGEX.lastIndex = 0;
let match = EMOJI_REGEX.exec(body);
let emojiBody = match && match[0] && match[0].length === body.length;
let contentBodyTrimmed = content.body.trim();
let match = EMOJI_REGEX.exec(contentBodyTrimmed);
let emojiBody = match && match[0] && match[0].length === contentBodyTrimmed.length;

let className = classNames('markdown-body', {
'emoji-body': emojiBody,
Expand Down

0 comments on commit a9a3d31

Please sign in to comment.