Emoji Plugin Irregularity

Background
I’ve created a test plugin to familiarize myself with adding custom emoji. During the process, I decided to add quite a few emoji (most everything from fontawesome) as an exercise. The plugin can be located at: https://github.com/SGColdSun/fa-emoji

Issue
Everything worked as intended initially. Went out to dinner, came back a few hours later to find that the emoji in past (and new) posts only displays correctly in the topic title, and the preview. The body of the message (once submitted), displays the emoji for a second or two before it defaults back to the :emoji-here: text.

An example of the issue can be seen here:
https://forums.ego.ninja/t/fa-adjust-fa-emoji-not-displaying-in-posts/22

Additional Notes
There is no errors in the log. No related errors in Google’s dev console.

It looks like the implementation you are using for adding emoji’s is outdated. It was overhauled a while ago.

Here is an example using the overhauled technique.
https://github.com/cpradio/discourse-plugin-vb-emoticons/blob/master/plugin.rb

5 Likes

Thanks :grinning:
I was aware that there was a newer way to display the emoji but was unaware that the previous way was no longer supported. It’ll be easy enough to switch over to the new method (which I’ll be doing tonight). For that I thank you.

Any idea why the previous way still works for the topic titles, previews, and the initial page submission but later reverts? Not that I plan on using the outdated method (I’m not), I’m just more interested in the cause of the irregularities.

Using register_emoji is producing the same results as the old method.
Topic titles show the emoji. The preview shows the emoji.
The final post once submitted shows the emoji for a second before turning back into the text version.

Added:
After rebuilding/rebaking all of the posts, it is working correctly.

Thanks :slight_smile:

3 Likes