Skip to content

Commit

Permalink
Merge pull request #4523 from MaciejKus/develop
Browse files Browse the repository at this point in the history
added support for apostrophe emojis
  • Loading branch information
engelgabriel authored Oct 4, 2016
2 parents 7e714be + c84ce33 commit 90c92bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/rocketchat-emoji/emojiParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ RocketChat.callbacks.add('renderMessage', (message) => {
}

if (_.trim(message.html)) {
//' to apostrophe (') for emojis such as :')
message.html = message.html.replace(/'/g, '\'');

Object.keys(RocketChat.emoji.packages).forEach((emojiPackage) => {
message.html = RocketChat.emoji.packages[emojiPackage].render(message.html);
});
Expand Down Expand Up @@ -36,6 +39,9 @@ RocketChat.callbacks.add('renderMessage', (message) => {
if (emojiOnly) {
message.html = checkEmojiOnly.unwrap().html();
}

//apostrophe (') back to '
message.html = message.html.replace(/\'/g, ''');
}

return message;
Expand Down

0 comments on commit 90c92bf

Please sign in to comment.