Let's say we have this text:
text = "You don't need to try to find hidden meaning:\nin this text :sun_with_face:!\nthis text : does not have any :meaning :D"
Now notice the :sun_with_face:
in the text above? That's what I am trying to get somehow highlighted by changing the boldness and the color of the Text Widget to that particular section.
Issue:
How to filter the text for
:these_words:
? You may notice that those areemoji.demojized()
emoji so an optional solution would be to highlight all words that are in theemoji.UNICODE_EMOJI
list but I feel that it will tax on the resources and time a lot (since the list contains over 1000 items)How to highlight the wanted stuff. Even though we might somehow solve the first issue, these demojized emoji are in the middle of the text...
Edit
Just to clarify: I know how to highlight the text from this question. I just need to know the location of the word to high light it, which is the tricky part. Also the :sun_with_face:. It can be anything as long as its open and closed with ':' and in-between there are no spaces () and newlines (
\n
).