mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-11 03:02:32 -05:00
Customize emoji aliases #9986
Open
opened 2025-11-02 08:55:00 -06:00 by GiteaMirror
·
8 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1.16.0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3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#9986
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @muzzsh on GitHub (Dec 18, 2022).
Feature Description
By now, there is no way to customize emoji alias(es) without rebuilding the gitea server since the predefined emoji aliases are hard coded.
This would be a problem when migrating from other VCS providers.
Here is an example, the ladybug couldn't be rendered properly because, in gitea, this emoji was called "lady_beetle" instead of "beetle" in bitbucket.org:
Can we add a configure section in the app.ini which is describing custom emoji aliases defined by the users(administrators)? Something like:
[ui.emoji_aliases]
beetle = lady_beetle
my_thumb = thumbsup
... ...
Screenshots
@muzzsh commented on GitHub (Dec 18, 2022):
A patch is ready to review https://github.com/go-gitea/gitea/pull/22156
@mrsdizzie commented on GitHub (Jan 4, 2023):
The real cause of this bug is that the emoji data used has not been updated from the upstream source. The alias beetle is a Unicode version 13 addition but Gitea still use Unicode version 12:
32e863439c/build/generate-emoji.go (L27-L28)I haven't tried, but assuming it still works just changing that to 13 (or higher) and running the build script should update Gitea emoji data to match what others are using. I believe it was set to 12 initially because 13 was new enough that anybody who hadn't updated their font or os would see missing emoji symbol for anything newer than 12 which showed up in the suggestions.
You can see the 'beetle' / 'lady_beetle' alias change here:
https://github.com/github/gemoji/pull/173
I think that should be the proper fix for this issue since most other sources aren't using custom aliases that differ from Gitea but the ones Gitea have are just out of date from upstream that others are using too.
@muzzsh commented on GitHub (Jan 4, 2023):
It's really good to know how this issue was actually caused, and it's fairly well to fix this issue by updating the Unicode version from the upstream.
My concern is, Unicode version 13 was published on Mar.10th, 2020, nearly 3 years ago, but we still have the problem now.
Can we add the customizable emoji alias feature for the administrators as a workaround in case some changes are to be made by the upstream, but gitea doesn't catch up?
@muzzsh commented on GitHub (Jan 4, 2023):
Plus, as the "Emoji Meaning" mentioned:
Not to be confused with 🐞 Lady Beetle, 🪳 Cockroach, 🐛 Bug, 🐜 Ant or other emoji representations of insects. https://emojipedia.org/beetle/
"beetle" and "lady_beetle" are two different emojis, but in the case shown in the screenshot I posted earlier, the bitbucket.org emoji collection seems confused about "beetle" and "lady_beetle". It's not a problem at all in most scenarios (if Gitea supports ”beetle“ as a valid emoji either way), but when migrating from bitbucket.org (what I'm doing), it would be nicer if I could keep consistency because tons of historical commit messages are using the confused "beetle".
@mrsdizzie commented on GitHub (Jan 4, 2023):
Agreed. It was never updated because there is no type of reminder system to do so once a year and this is probably the first reported issue to be seen as a result. I added the original set so that is probably my fault sorry!
Gitea should catch up and I think it would fix most issues. I added a PR to update the emoji data set for all of Gitea #22342. Maybe since it involves no code change it could be back ported and get to users sooner than a new configuration option would be able to.
If another configuration option exists it should have its own good use case and not be needed only as a workaround for the general emoji dataset being out dated for a few years.
I'm not voting against any new option or trying to replace the original PR, just using this issue to highlight that the emoji data has gotten out of sync / date with upstream. If the PR is still helpful afterwards then great.
I commented in the PR above it is pretty easy to update the dataset when a new unicode version is supported upstream (which is shared with Github and many other places). It should probably be updated once per year whenever upstream adds new unicode versions.
@mrsdizzie commented on GitHub (Jan 4, 2023):
The initial missing emoji on
:beetle:is now fixedhttps://try.gitea.io/mrsdizzie/testme/issues/1#issuecomment-133733

To the other point, it does show a different emoji. bitbucket made the decision to create a custom alias 'beetle -> lady_beetle' in the past when the only emoji to exist was lady_beetle. Unicode then added a separate beetle emoji and now bitbucket is stuck unable to use the new 'beetle' alias because it already points somewhere else.
Having custom alias mapping would create the same problem for Gitea admins. In this example, once you set
beetle -> lady_beetlethe 'real' beetle alias no longer works. Of course, that mapping might be more important than using a new 'beetle' in your case and people have to work with existing text out of their control.@mrsdizzie commented on GitHub (Jan 4, 2023):
Unrelated to the above but I think custom markdown filters are a cool and underused feature in Gitea and should come up any time somebody wants to change things without having to compile Gitea itself.
Untested, but you could maybe correct this problem on your Gitea instance now with a script like this:
Though I doubt this gets called in all places that emoji alias conversion happens so maybe it isn't helpful if it needs to be inside of a label or somewhere particular that doesn't render markdown otherwise
@muzzsh commented on GitHub (Jan 5, 2023):
No one should be blamed for contributing to an open source project!
Agree, the new option might be abused using, leading to non-standard emoji aliases everywhere.
Yep, it's much more important to keep consistency than to have new features brought by the new Unicode version in the migration cases.
My suggestion is, to add a caution note in the doc to remind the admins to be aware of the downsides.