diff --git a/content.py b/content.py index 3852ab515..e069ebf13 100644 --- a/content.py +++ b/content.py @@ -65,7 +65,7 @@ def replaceEmojiFromTags(content: str,tag: [],messageType: str) -> str: if iconName.startswith('1'): if '.' in iconName: iconName=iconName.split('.')[0] - content=content.replace(tagItem['name'],'\\u'+iconName) + content=content.replace(tagItem['name'],chr(int("0x"+iconName,16))) htmlClass='emoji' if messageType=='post header': htmlClass='emojiheader' diff --git a/tests.py b/tests.py index 656838295..f2a7ccd28 100644 --- a/tests.py +++ b/tests.py @@ -1391,7 +1391,8 @@ def testAddEmoji(): tags.append(tag) content=contentModified contentModified=replaceEmojiFromTags(content,tags,'content') - assert contentModified=='
Emoji \\u1F34B \\u1F353 \\u1F34C
' + #print('contentModified: '+contentModified) + assert contentModified=='Emoji 🍋 🍓 🍌
' os.chdir(baseDirOriginal) shutil.rmtree(baseDirOriginal+'/.tests')