How to create a tag "šŸŽ„"?

AI-generated summary

The discussion revolves around creating a tag with an emoji, specifically ā€œ:movie_camera:ā€, in a Discourse forum. thoka reports that attempting to create such a tag via the interface results in it being immediately removed, and while it can be created and assigned via the Rails console, it fails to appear in searches or selectors. tobiaseigen suggests the issue may stem from how emojis are processed, referencing a related topic on emoji handling in tag names. thoka clarifies that while tags like ā€œ:movie_camera:movieā€ work, a pure emoji tag does not, suspecting that emoji-to-Markdown translation is a factor. tobiaseigen explains that this currently requires hacking and suggests a feature request for better emoji tag support, including options to display only the emoji or both emoji and text. sid321 offers a manual workaround via the console, but thoka confirms it doesn’t resolve the UI search issue. The discussion highlights the need for a more flexible system allowing emojis in tag names without automatic conversion to Markdown, and the potential for UI customization to hide tag text when using emoji.

I would like to learn how to create a tag with name="šŸŽ„".

If I try to to add such a tag via interface it is removed immediately.

If I create and assign the tag via rails console, it will be shown and can be selected by clicking but it will not be included in any tag search or selector.

Maybe have a look at this topic?

Hm. I still don’t understand the problem after having read the topic.

If I choose ā€œ:movie_camera:movieā€ then I’m able to search and assign the tag via UI.

So it seems that emojis are stripped in searches and a pure emoji string therefore is not a valid search term?

My conjecture is that the translation of emojis into their Markdown equivalent is also a contributing factor.

Are there any downsides to use emojis in tag names, which would favor emoji-free tag names decorated with Tag Icons in the UI?

What you’re trying to do will currently taking some hacking - there is no straightforward way to do it.

I think there is a legit feature request in here - to allow tags to be configured with an emoji and also to allow determining whether both tag text and tag emoji are displayed, or just tag emoji.

There is a theme component for allowing tags to get icons, but there is no way currently to suppress the tag text. Maybe this could be added to the component as an an option?

You may try doing it manually, not sure if it works but yeah try giving it a shot:
tag = Tag.find_by(name: ā€˜movie_camera’)
tag.update!(name: ā€œ:movie_camera:ā€)

Tried that (see above). It is not possible to assign such a tag via the interface.

As a user in our forum noted, searching for emoji in UI is quite difficult, so I like @tobiaseigen’s advice on hiding the tag name in the UI (perhaps limited to special places) while using it in the backend.

I would appreciate any pointers to the philosophy and machinery behind emoji to :emoji-name: translation. I do understand, that having pure ASCII markdown might have some benefits, but I would like to have the option to disable these conversions, keeping only the Unicode text.