SebOuellette / LiveBot

An app that allows you to be inside a bot!
Apache License 2.0
730 stars 175 forks source link

[Bug/Improvement] Emoji converter #187

Closed RobinRMC closed 1 year ago

RobinRMC commented 2 years ago

What release are you using?

Error

The bot gives emoji conversion priority over markdown.

Steps required to reproduce the bug

Refer to the screenshot

Screenshots (examples)

Expected result: https://imgur.com/VyUo1Qx Actual result: https://imgur.com/dQPrLH2

Improvement

Give markdown priority over emoji conversion. In the examples (screenshots), it should choose to use the star (*) for markdown instead of an emoji. I think this can be achieved by checking if a markdown pattern is recognized, like double stars (**) or when there is a star (*) present after a colon (:), check if there is another star somewhere earlier in the message without a colon (:) in front of it. If there is a markdown pattern, skip the conversion of the stars. Or if two stars (**) are present after a colon (:), don't convert the colon and first star to an emoji, but rather give priority to the two stars (**). Another solution would be removing the conversion to an emoji of ':*'.

The last solution is how I fixed the issue for myself.