Skip to content
Browse files

Interprets :o and :O

  • Loading branch information...
1 parent 0beea81 commit 89967d1d1036d73390c82314773e081456e706f7 @adam-lynch adam-lynch committed
Showing with 7 additions and 0 deletions.
  1. +1 −0 src/emojify.js
  2. +6 −0 tests/spec/string.js
View
1 src/emojify.js
@@ -42,6 +42,7 @@
var emoticons = {
/* :..: */ named: /:([a-z0-9A-Z_-]+):/,
/* :-) */ smile: /:-?\)/g,
+ /* :o */ open_mouth: /:o/i,
/* :-o */ scream: /:-o/gi,
/* :-] */ smirk: /[:;]-?]/g,
/* :-D */ grinning: /[:;]-?d/gi,
View
6 tests/spec/string.js
@@ -113,6 +113,12 @@ JS.Test.describe('emojify used with flat strings', function() {
this.assertEqual("I'd better not see emoji in this string; that'd suck", result);
});
+ this.it("interprets :o and :O", function () {
+ var text = ":o :O";
+ var result = emojify.replace(text);
+ this.assertEqual("<img align=\'absmiddle\' alt=\':open_mouth:\' class=\'emoji\' src=\'images/emoji/open_mouth.png\' title=\':open_mouth:\' /> <img align=\'absmiddle\' alt=\':open_mouth:\' class=\'emoji\' src=\'images/emoji/open_mouth.png\' title=\':open_mouth:\' />", result);
+ });
+
});
this.describe('with ignore_emoticons option enabled', function () {

0 comments on commit 89967d1

Please sign in to comment.
Something went wrong with that request. Please try again.