[PR #5168] [MERGED] Fix emojis not showing in commit messages #17677

Closed
opened 2025-11-02 14:57:21 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/5168
Author: @jamesa
Created: 10/24/2018
Status: Merged
Merged: 10/29/2018
Merged by: @techknowlogick

Base: masterHead: emoji-in-commit-msg


📝 Commits (3)

  • fd79d21 Fix emojis not showing in commit messages
  • 352e345 Merge branch 'master' into emoji-in-commit-msg
  • 52496fc Merge branch 'master' into emoji-in-commit-msg

📊 Changes

2 files changed (+6 additions, -1 deletions)

View changed files

📝 public/js/index.js (+5 -0)
📝 templates/repo/diff/page.tmpl (+1 -1)

📄 Description

Fixes #5150

This fixes the issue where emojis were not showing up in the commit messages in the file tree, and on the commit view.

I was looking at two approaches for this:

  1. Modify the code that generates the commit message links
  2. Modify the frontend code that calls emojify

I went with the second approach and would like some feedback on that. I went this route instead of modifying the code that generates the commit link, since it looked like I would need to make a new processor in modules/markup/html.go to facilitate adding the has-emoji class to these links. And that seemed like overkill for this small use case.

It seems natural for emojify to work on children of the has-emoji elements, but it doesn't. (Deprecated, and only used to work by ID). So this will look at the children of each has-emoji element and insert emojis into any children that are links.

I only added emojis to links because I was worried about potential performance impacts if an element has a lot of children. If you think that's still a concern though then maybe we should go with the first approach?

Thanks for your consideration and feedback!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/5168 **Author:** [@jamesa](https://github.com/jamesa) **Created:** 10/24/2018 **Status:** ✅ Merged **Merged:** 10/29/2018 **Merged by:** [@techknowlogick](https://github.com/techknowlogick) **Base:** `master` ← **Head:** `emoji-in-commit-msg` --- ### 📝 Commits (3) - [`fd79d21`](https://github.com/go-gitea/gitea/commit/fd79d211ffa99834e3baea8bc16e9df95e13ae95) Fix emojis not showing in commit messages - [`352e345`](https://github.com/go-gitea/gitea/commit/352e3459c38da87b3a16351cb9d4816e78171d40) Merge branch 'master' into emoji-in-commit-msg - [`52496fc`](https://github.com/go-gitea/gitea/commit/52496fc6b5c399ea0dcf0dbc9e50f749a67c0a2f) Merge branch 'master' into emoji-in-commit-msg ### 📊 Changes **2 files changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `public/js/index.js` (+5 -0) 📝 `templates/repo/diff/page.tmpl` (+1 -1) </details> ### 📄 Description Fixes #5150 This fixes the issue where emojis were not showing up in the commit messages in the file tree, and on the commit view. I was looking at two approaches for this: 1. Modify the code that generates the commit message links 2. Modify the frontend code that calls emojify I went with the second approach and would like some feedback on that. I went this route instead of modifying the code that generates the commit link, since it looked like I would need to make a new processor in `modules/markup/html.go` to facilitate adding the `has-emoji` class to these links. And that seemed like overkill for this small use case. It seems natural for emojify to work on children of the `has-emoji` elements, but it doesn't. (Deprecated, and only used to work by ID). So this will look at the children of each `has-emoji` element and insert emojis into any children that are links. I only added emojis to links because I was worried about potential performance impacts if an element has a lot of children. If you think that's still a concern though then maybe we should go with the first approach? Thanks for your consideration and feedback! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 14:57:21 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17677