13 lines
312 B
Python
13 lines
312 B
Python
import emoji
|
|
|
|
|
|
def replace_emojis(input_text):
|
|
'''
|
|
Replaces emojis in text with a custom LaTeX sequence.
|
|
:param input_text:
|
|
:return:
|
|
'''
|
|
for char in input_text:
|
|
if emoji.is_emoji(char):
|
|
input_text = input_text.replace(char, f"\\emoji{{{char}}}")
|
|
return input_text
|