Chat Emotes

Chat Emotes

2.9k Downloads

SafeReplace requires rework to support unicode and lines with multiple chained emote tags without delimiters

Vladinator opened this issue ยท 1 comments

commented

The current implementation of SafeReplace doesn't allow multiple emote name references without spacing, for the Twitch emotes this works and makes sense, because KEKW and KEKWKEKW are different, thus the latter one won't be replaced with any images.

On the other hand the Discord once are properly wrapped in colons that make it technically possible to replace all occurrences in strings like :grin::grin: and with todays implementation the first one will be replaced, but any subsequent once will not.

The segmenter will split up on words when not inside special escape sequences, but this fails since : is not a space, and it could also be something else than emote name reference, so it's all kept in the same line, thus only one gets replaced as we only expect one potential emote per word.

Unicode replacements encounter the same issue, where bits alone don't mean much, but ideally the emoji range should also be split for the replacement to work properly, so each emoji has its own word.

The quick solution to the unicode problem is to perform the unicode search and just split all the unicode characters indiscriminately, but this won't solve the underlying issue. One could argue it's not an issue since the handling is identical for KEKW and :grin: technically speaking, but from a user perspective grin is the name and the : is just wrapper.

commented

After massive reworks, the latest release resolves these concerns. Things can always get better, but right now it's a very acceptable solution.

https://github.com/Vladinator89/wow-addon-chatemotes/releases/tag/v9.1.5.211205

d27e01e