Emoji not showing up on 404 page not found

AI-generated summary

The discussion addresses an issue where emojis like :mega: are not rendering on the 404 page in Discourse. debryc reports the problem, noting that while some emojis (e.g., calendar) render, others do not. Stephen links it to a known markdown parsing issue on the 404 page. codinghorror questions the rendering path, and sam clarifies that emoji rendering typically happens client-side, with no server-side function for emojifying text. j.jaffeux proposes a fix via a pull request (#7802), which would enable both Unicode and code-based emoji rendering, including skin tones. codinghorror raises performance concerns, but j.jaffeux reassures that the fix won’t impact performance, as the 404 page is cached in Redis and emoji lookup uses an in-memory list.

On our 404 page not found, I see that :mega doesn’t become the :mega: emoji (see first post).

The calendar emoji on the last post is rendering, but I didn’t use Discourse’s emoji chooser to get that particular emoji.

2 likes

AFAIK it’s the same reason the markdown links weren’t parsed in the other report you made about the 404 page.

Not quite, I think this should go through the same rendering path for topic titles. Who was the last person to work on 404 page @sam?

I think @techAPJ did but not sure. I am not sure if we even have a server side function to “emojify” a bunch of text, we always do this on the client.

I would not mind getting this fixed but it is fiddly, @j.jaffeux can you think of an easy fix here?

3 likes

I think that should do it:

https://github.com/discourse/discourse/pull/7802

The following topic title:
FREE to USA Discourse hoster :blush: :man:t2:

Would result in (both unicode and code replaced, and works with skin tones):

6 likes

Will this be a perf issue? We need to confirm as 404 gets hit a lot, and systematically sometimes.

3 likes

No this won’t, this page is cached in redis.

Also the lookup wont happen with filesystem, but using the Emoji list which is in memory (redis too).

3 likes

Merged