noodlebox / KawaiiDiscord

Add huge sets of external emotes to Discord
MIT License
6 stars 2 forks source link

Emotes are not always parsed when editing edited messages. #5

Closed noodlebox closed 8 years ago

noodlebox commented 8 years ago

When editing a text-only message that has been edited at least once before, emote parsing is not triggered on the new content.

This most likely happens because ReactJS (in trying to minimize DOM changes) simply changes the data for the text node, which does not trigger the observer callback. If a message had not been edited before, the adding of the "(edited)" tag triggers the callback. If there are any existing emotes, a new text node is created as a child of the img element (the cause of a previously fixed bug), also triggering the callback.