]> source.dussan.org Git - gitea.git/commitdiff
Fix emojis not showing in commit messages (#5168)
authorJames Anderson <james@jamesa.me>
Mon, 29 Oct 2018 21:00:35 +0000 (17:00 -0400)
committertechknowlogick <hello@techknowlogick.com>
Mon, 29 Oct 2018 21:00:34 +0000 (17:00 -0400)
Fixes #5150

Signed-off-by: James Anderson <james@jamesa.me>
public/js/index.js
templates/repo/diff/page.tmpl

index 7700093598dc65f994212fb8aa11dafa62f8194a..0bc28c4f9654f5a7c3f8595f577a02afcc1cf83d 100644 (file)
@@ -1766,6 +1766,11 @@ $(document).ready(function () {
     var hasEmoji = document.getElementsByClassName('has-emoji');
     for (var i = 0; i < hasEmoji.length; i++) {
         emojify.run(hasEmoji[i]);
+        for (var j = 0; j < hasEmoji[i].childNodes.length; j++) {
+            if (hasEmoji[i].childNodes[j].nodeName === "A") {
+                emojify.run(hasEmoji[i].childNodes[j])
+            }
+        }
     }
 
     // Clipboard JS
index ba0cf348d4fc3c0e897cdb767e19435ed2944abd..cc8811848e3377a4c18d31e65cf6b5a4e4a2f47f 100644 (file)
@@ -9,7 +9,7 @@
                                <a class="ui floated right blue tiny button" href="{{EscapePound .SourcePath}}">
                                        {{.i18n.Tr "repo.diff.browse_source"}}
                                </a>
-                               <h3>{{RenderCommitMessage .Commit.Message $.RepoLink $.Repository.ComposeMetas}}{{template "repo/commit_status" .CommitStatus}}</h3>
+                               <h3 class="has-emoji">{{RenderCommitMessage .Commit.Message $.RepoLink $.Repository.ComposeMetas}}{{template "repo/commit_status" .CommitStatus}}</h3>
                                {{if IsMultilineCommitMessage .Commit.Message}}
                                        <pre class="commit-body">{{RenderCommitBody .Commit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
                                {{end}}