Skip to content

Commit

Permalink
Merge pull request #181 from theMarix/fix-python2
Browse files Browse the repository at this point in the history
Fix matching of non-ASCII emoji names on Python 2
  • Loading branch information
TahirJalilov authored Aug 1, 2021
2 parents 0a3809f + c6b129f commit 69c72d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
emoji
=====

UNRELEASED
----------

* Fix matching of non-ASCII emoji names on Python 2

1.4.2
-----
* Delimiter for German time naming changed from ":" to "."
Expand Down
2 changes: 1 addition & 1 deletion emoji/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def emojize(
Python is fun ❤️ #red heart, not black heart
"""
EMOJI_UNICODE = unicode_codes.EMOJI_UNICODE[language]
pattern = re.compile(u'(%s[\\w\\-&.’”“()!#*+?–,/]+%s)' % delimiters)
pattern = re.compile(u'(%s[\\w\\-&.’”“()!#*+?–,/]+%s)' % delimiters, flags=re.UNICODE)

def replace(match):
mg = match.group(1).replace(delimiters[0], _DEFAULT_DELIMITER).replace(
Expand Down

0 comments on commit 69c72d1

Please sign in to comment.