diff --git a/zephyr/lib/bugdown/__init__.py b/zephyr/lib/bugdown/__init__.py
index 20e872b307..ca8c0ca4d7 100644
--- a/zephyr/lib/bugdown/__init__.py
+++ b/zephyr/lib/bugdown/__init__.py
@@ -86,39 +86,6 @@ class Gravatar(markdown.inlinepatterns.Pattern):
% (gravatar_hash(match.group('email')),))
return img
-# We first map syntax of the form ":)" to the ":smile:" syntax, and
-# then map syntax of the form ":foo:" to the emoji named "foo".
-smiley_to_emoji = {
- # We're somewhat restrained here, to avoid false positives
- ":-)" : "blush", # This is a very weird coopting of the blush emoticon, but the normal
- ":)" : "blush", # smile was so smiley that it became indistinguishable from grin.
- ":-(" : "worried",
- ":(" : "worried",
- ";-)" : "wink",
- ";)" : "wink",
- ":-P" : "stuck_out_tongue",
- ":-p" : "stuck_out_tongue",
- ":P" : "stuck_out_tongue",
- ":p" : "stuck_out_tongue",
- ":-*" : "kissing_closed_eyes",
- ":*" : "kissing_closed_eyes",
- "8-)" : "sunglasses",
- "8)" : "sunglasses",
- "O:-)": "innocent",
- "O:)" : "innocent",
- "o:-)": "innocent",
- "o:)" : "innocent",
- ":-/" : "confused",
- ":/" : "confused",
- ":'(" : "cry",
- ":-D" : "smiley",
- ":D" : "smiley",
- ":-|" : "expressionless",
- ":|" : "expressionless",
- "<3" : "heart",
- }
-smiley_regex = '|'.join([re.escape(face) for face in smiley_to_emoji])
-
path_to_emoji = os.path.join(os.path.dirname(__file__), '..', '..',
# This should be zephyr/
'static', 'third', 'gemoji', 'images', 'emoji', '*.png')
@@ -140,13 +107,6 @@ class Emoji(markdown.inlinepatterns.Pattern):
return orig_syntax
return make_emoji(name, orig_syntax)
-class Smiley(markdown.inlinepatterns.Pattern):
- def handleMatch(self, match):
- orig_syntax = match.group("syntax")
- if orig_syntax not in smiley_to_emoji:
- return orig_syntax
- return make_emoji(smiley_to_emoji[orig_syntax], orig_syntax)
-
def fixup_link(link):
"""Set certain attributes we want on every link."""
link.set('target', '_blank')
@@ -303,7 +263,6 @@ class Bugdown(markdown.Extension):
md.inlinePatterns.add('gravatar', Gravatar(r'!gravatar\((?P
xxxxxxx xxxxx xxxx xxxxx:
\nxxxxxx: xxx
(':whale:', emoji_img(':whale:')),
(':fakeemoji:', ':fakeemoji:'),
(':even faker smile:', ':even faker smile:'),
- # Smileys
- (':)', emoji_img(':)', 'blush')),
- (';)', emoji_img(';)', 'wink')),
- ('8)', emoji_img('8)', 'sunglasses')),
- ('o:)', emoji_img('o:)', 'innocent')),
- ('<3', emoji_img('<3', 'heart')),
- (':(', emoji_img(':(', 'worried')),
- ('x<3', 'x<3')]
+ ]
# Check every single emoji
for img in emoji_list:
emoji_text = ":%s:" % img
test_cases.append((emoji_text, emoji_img(emoji_text)))
- # Check every single smiley
- for smiley, emoji in smiley_to_emoji.iteritems():
- # Fixup for <3
- smiley_escaped_text = smiley.replace('<', '<')
- test_cases.append((smiley, emoji_img(smiley_escaped_text, emoji)))
-
for input, expected in test_cases:
self.assertEqual(convert(input), '
%s
' % expected) @@ -1981,7 +1968,7 @@ xxxxxxx\nxxxxxxx xxxxx xxxx xxxxx:
\nxxxxxx: xxx
msg = 'test :smile: again :poop:\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:'
converted = convert(msg)
self.assertEqual(converted, '
test ' + emoji_img(':smile:') + ' again ' + emoji_img(':poop:') + '
\n'
- + emoji_img(':)', 'blush') + ' foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender: