diff --git a/modules/markup/html.go b/modules/markup/html.go index c5bb4d847b..8fbfee6a53 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -284,6 +284,8 @@ func RenderDescriptionHTML( urlPrefix: urlPrefix, procs: []processor{ descriptionLinkProcessor, + emojiShortCodeProcessor, + emojiProcessor, }, } return ctx.postProcess(rawHTML) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 8d188e32e5..a6c5d41978 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -865,8 +865,8 @@ issues.label_templates.info = No labels exist yet. Create a label with 'New Labe issues.label_templates.helper = Select a label set issues.label_templates.use = Use Label Set issues.label_templates.fail_to_load_file = Failed to load label template file '%s': %v -issues.add_label_at = added the
%s
label %s -issues.remove_label_at = removed the
%s
label %s +issues.add_label_at = added the
%s
label %s +issues.remove_label_at = removed the
%s
label %s issues.add_milestone_at = `added this to the %s milestone %s` issues.change_milestone_at = `modified the milestone from %s to %s %s` issues.remove_milestone_at = `removed this from the %s milestone %s` diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index 72b36432ef..42e8d1f662 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -29,7 +29,7 @@
- {{if .DescriptionHTML}}

{{.DescriptionHTML}}

{{end}} + {{if .DescriptionHTML}}

{{.DescriptionHTML}}

{{end}} {{if .Topics }}
{{range .Topics}} diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index c11a841b2d..41f6be6430 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -129,7 +129,7 @@
{{$.i18n.Tr "repo.activity.published_release_label"}}
{{.TagName}} {{if not .IsTag}} - {{.Title}} + {{.Title | RenderEmoji}} {{end}} {{TimeSinceUnix .CreatedUnix $.Lang}}

@@ -146,7 +146,7 @@ {{range .Activity.MergedPRs}}

{{$.i18n.Tr "repo.activity.merged_prs_label"}}
- #{{.Index}} {{.Issue.Title}} + #{{.Index}} {{.Issue.Title | RenderEmoji}} {{TimeSinceUnix .MergedUnix $.Lang}}

{{end}} @@ -162,7 +162,7 @@ {{range .Activity.OpenedPRs}}

{{$.i18n.Tr "repo.activity.opened_prs_label"}}
- #{{.Index}} {{.Issue.Title}} + #{{.Index}} {{.Issue.Title | RenderEmoji}} {{TimeSinceUnix .Issue.CreatedUnix $.Lang}}

{{end}} @@ -178,7 +178,7 @@ {{range .Activity.ClosedIssues}}

{{$.i18n.Tr "repo.activity.closed_issue_label"}}
- #{{.Index}} {{.Title}} + #{{.Index}} {{.Title | RenderEmoji}} {{TimeSinceUnix .ClosedUnix $.Lang}}

{{end}} @@ -194,7 +194,7 @@ {{range .Activity.OpenedIssues}}

{{$.i18n.Tr "repo.activity.new_issue_label"}}
- #{{.Index}} {{.Title}} + #{{.Index}} {{.Title | RenderEmoji}} {{TimeSinceUnix .CreatedUnix $.Lang}}

{{end}} @@ -215,9 +215,9 @@
{{$.i18n.Tr "repo.activity.unresolved_conv_label"}}
#{{.Index}} {{if .IsPull}} - {{.Title}} + {{.Title | RenderEmoji}} {{else}} - {{.Title}} + {{.Title | RenderEmoji}} {{end}} {{TimeSinceUnix .UpdatedUnix $.Lang}}

diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl index 0a906d1f18..c2410e8c1d 100644 --- a/templates/repo/blame.tmpl +++ b/templates/repo/blame.tmpl @@ -34,7 +34,7 @@
-
+
diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 5dc12c642b..92da6c1b29 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -74,10 +74,10 @@ - diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 1405378bd7..1216b5f40a 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -64,7 +64,7 @@ {{end}}
-
+
{{if .IsMarkup}} {{if .FileContent}}{{.FileContent | Safe}}{{end}} {{else if .IsRenderedHTML}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 9e77a4866c..2add12577d 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -40,7 +40,7 @@ {{template "repo/commit_status" .LatestCommitStatus}} {{ $commitLink:= printf "%s/commit/%s" .RepoLink .LatestCommit.ID }} - {{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}} + {{RenderCommitMessageLinkSubject .LatestCommit.Message $.RepoLink $commitLink $.Repository.ComposeMetas}} {{if IsMultilineCommitMessage .LatestCommit.Message}} @@ -94,8 +94,8 @@ {{end}}
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index 26ed049e63..e9d02d5087 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -80,7 +80,7 @@ {{end}}
-
+
{{.content | Str2html}}
{{if .sidebarPresent}} diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index 5d8bc327e6..82da91c811 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -123,7 +123,7 @@ especially on mobile views. */}} {{range .}} - {{.Name | RenderEmojiPlain}} + {{.Name | RenderEmoji}} {{end}} {{end}} diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 6241ad5072..0036bf6a4f 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -1272,6 +1272,13 @@ i.icon.centerlock { font-size: 1em; } +.label > .emoji { + font-size: 1em; +} + +.dropdown .emoji { + font-size: 1em; +} .emoji img, .reaction img { border-width: 0 !important;
{{if $.PageIsWiki}} - {{.Summary}} + {{.Summary | RenderEmoji}} {{else }} {{ $commitLink:= printf "%s/%s/%s/commit/%s" AppSubUrl $.Username $.Reponame .ID }} - {{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}} + {{RenderCommitMessageLinkSubject .Message $.RepoLink $commitLink $.Repository.ComposeMetas}} {{end}} {{if IsMultilineCommitMessage .Message}} diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index f5b8d8042d..288b2316a6 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -35,7 +35,7 @@
-
+
{{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} diff --git a/templates/repo/graph.tmpl b/templates/repo/graph.tmpl index 20fe3d1527..5f4d9f1d62 100644 --- a/templates/repo/graph.tmpl +++ b/templates/repo/graph.tmpl @@ -24,7 +24,7 @@ {{ .ShortRev}} {{.Branch}} - {{RenderCommitMessage .Subject $.RepoLink $.Repository.ComposeMetas}} by + {{RenderCommitMessage .Subject $.RepoLink $.Repository.ComposeMetas}} by {{.Author}} diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 2397cb1b88..51e924747c 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -5,7 +5,7 @@ {{template "base/alert" .}}
- {{if .Repository.DescriptionHTML}}{{.Repository.DescriptionHTML}}{{else if .IsRepositoryAdmin}}{{.i18n.Tr "repo.no_desc"}}{{end}} + {{if .Repository.DescriptionHTML}}{{.Repository.DescriptionHTML}}{{else if .IsRepositoryAdmin}}{{.i18n.Tr "repo.no_desc"}}{{end}} {{.Repository.Website}}
{{if .RepoSearchEnabled}} diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl index 5692f36d22..e9f235e3b7 100644 --- a/templates/repo/issue/labels/label_list.tmpl +++ b/templates/repo/issue/labels/label_list.tmpl @@ -31,11 +31,11 @@
  • -
    {{svg "octicon-tag" 16}} {{.Name | RenderEmojiPlain}}
    +
    {{svg "octicon-tag" 16}} {{.Name | RenderEmoji}}
    -
    - {{.Description}} +
    + {{.Description | RenderEmoji}}
    @@ -74,11 +74,11 @@
  • -
    {{svg "octicon-tag" 16}} {{.Name | RenderEmojiPlain}}
    +
    {{svg "octicon-tag" 16}} {{.Name | RenderEmoji}}
    -
    - {{.Description}} +
    + {{.Description | RenderEmoji}}
    diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl index dbfee8480f..2b9078dfc1 100644 --- a/templates/repo/issue/list.tmpl +++ b/templates/repo/issue/list.tmpl @@ -51,7 +51,7 @@ {{.i18n.Tr "repo.issues.filter_label_exclude" | Safe}} {{.i18n.Tr "repo.issues.filter_label_no_select"}} {{range .Labels}} - {{if .IsExcluded}}{{svg "octicon-circle-slash" 16}}{{else if .IsSelected}}{{svg "octicon-check" 16}}{{end}} {{.Name | RenderEmojiPlain}} + {{if .IsExcluded}}{{svg "octicon-circle-slash" 16}}{{else if .IsSelected}}{{svg "octicon-check" 16}}{{end}} {{.Name | RenderEmoji}} {{end}}
    @@ -155,7 +155,7 @@ @@ -220,7 +220,7 @@ {{end}} {{range .Labels}} - {{.Name | RenderEmojiPlain}} + {{.Name | RenderEmoji}} {{end}} {{if .NumComments}} diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index 5307c05733..665d262262 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -61,7 +61,7 @@ {{.i18n.Tr "repo.issues.filter_label_exclude" | Safe}} {{.i18n.Tr "repo.issues.filter_label_no_select"}} {{range .Labels}} - {{if .IsExcluded}}{{svg "octicon-circle-slash" 16}}{{else if contain $.SelLabelIDs .ID}}{{svg "octicon-check" 16}}{{end}} {{.Name}} + {{if .IsExcluded}}{{svg "octicon-circle-slash" 16}}{{else if contain $.SelLabelIDs .ID}}{{svg "octicon-check" 16}}{{end}} {{.Name | RenderEmoji}} {{end}}
  • @@ -148,8 +148,8 @@ {{end}}
    #{{.Index}}
    - {{.Title}} + {{.Title | RenderEmoji}} {{if .IsPull }} {{if (index $.CommitStatus .PullRequest.ID)}} @@ -196,7 +196,7 @@ {{end}} {{range .Labels}} - {{.Name}} + {{.Name | RenderEmoji}} {{end}} {{if .NumComments}} diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 951fa965ea..a42a4d9ad5 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -56,14 +56,14 @@
    {{.i18n.Tr "repo.issues.new.clear_labels"}}
    {{if or .Labels .OrgLabels}} {{range .Labels}} - {{svg "octicon-check" 16}} {{.Name | RenderEmojiPlain}} - {{if .Description }}
    {{.Description | RenderEmojiPlain}}{{end}}
    + {{svg "octicon-check" 16}} {{.Name | RenderEmoji}} + {{if .Description }}
    {{.Description | RenderEmoji}}{{end}}
    {{end}}
    {{range .OrgLabels}} - {{svg "octicon-check" 16}} {{.Name | RenderEmojiPlain}} - {{if .Description }}
    {{.Description | RenderEmojiPlain}}{{end}}
    + {{svg "octicon-check" 16}} {{.Name | RenderEmoji}} + {{if .Description }}
    {{.Description | RenderEmoji}}{{end}}
    {{end}} {{else}}
    {{.i18n.Tr "repo.issues.new.no_items"}}
    @@ -73,10 +73,10 @@
    {{.i18n.Tr "repo.issues.new.no_label"}} {{range .Labels}} - {{.Name | RenderEmojiPlain}} + {{.Name | RenderEmoji}} {{end}} {{range .OrgLabels}} - {{.Name | RenderEmojiPlain}} + {{.Name | RenderEmoji}} {{end}}
    diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index c44da22720..2e42c75772 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -46,7 +46,7 @@ {{end}}
    -
    +
    {{if .Issue.RenderedContent}} {{.Issue.RenderedContent|Str2html}} {{else}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index a3b4fb81e0..99884a6796 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -43,7 +43,7 @@ {{end}}
    -
    +
    {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} @@ -163,7 +163,7 @@ {{.Poster.GetDisplayName}} - {{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape|RenderEmojiPlain) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape|RenderEmojiPlain) $createdStr | Safe}}{{end}} + {{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape|RenderEmoji) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape|RenderEmoji) $createdStr | Safe}}{{end}}
    {{end}} @@ -412,7 +412,7 @@
    -
    +
    {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} @@ -483,7 +483,7 @@ {{.Poster.GetDisplayName}} {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdSubStr | Safe}}
    -
    +
    {{if .RenderedContent}} {{.RenderedContent|Str2html}} {{else}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 2c355a9c00..0f34231b17 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -111,13 +111,13 @@
    {{.i18n.Tr "repo.issues.new.clear_labels"}}
    {{if or .Labels .OrgLabels}} {{range .Labels}} - {{svg "octicon-check" 16}} {{.Name | RenderEmojiPlain}} - {{if .Description }}
    {{.Description | RenderEmojiPlain}}{{end}}
    + {{svg "octicon-check" 16}} {{.Name | RenderEmoji}} + {{if .Description }}
    {{.Description | RenderEmoji}}{{end}}
    {{end}}
    {{range .OrgLabels}} - {{svg "octicon-check" 16}} {{.Name | RenderEmojiPlain}} - {{if .Description }}
    {{.Description | RenderEmojiPlain}}{{end}}
    + {{svg "octicon-check" 16}} {{.Name | RenderEmoji}} + {{if .Description }}
    {{.Description | RenderEmoji}}{{end}}
    {{end}} {{else}}
    {{.i18n.Tr "repo.issues.new.no_items"}}
    @@ -128,12 +128,12 @@ {{.i18n.Tr "repo.issues.new.no_label"}} {{range .Labels}} {{end}} {{range .OrgLabels}} {{end}} @@ -414,7 +414,7 @@ {{range .BlockingDependencies}}
    #{{.Issue.Index}} - {{.Issue.Title}} + {{.Issue.Title | RenderEmoji}}
    {{.Repository.OwnerName}}/{{.Repository.Name}}
    {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} @@ -441,7 +441,7 @@ {{range .BlockedByDependencies}}
    #{{.Issue.Index}} - {{.Issue.Title}} + {{.Issue.Title | RenderEmoji}}
    {{.Repository.OwnerName}}/{{.Repository.Name}}
    {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl index 6283548eaa..e5736a059f 100644 --- a/templates/repo/settings/lfs_file.tmpl +++ b/templates/repo/settings/lfs_file.tmpl @@ -12,7 +12,7 @@
    -
    +
    {{if .IsMarkup}} {{if .FileContent}}{{.FileContent | Safe}}{{end}} {{else if .IsRenderedHTML}} diff --git a/templates/repo/settings/lfs_file_find.tmpl b/templates/repo/settings/lfs_file_find.tmpl index 1057cfa945..5a2a168bec 100644 --- a/templates/repo/settings/lfs_file_find.tmpl +++ b/templates/repo/settings/lfs_file_find.tmpl @@ -16,10 +16,10 @@ {{svg "octicon-file" 16}} {{.Name}}
    + - - {{.Summary}} + + {{.Summary | RenderEmoji}} - - {{$commit.Summary}} + + {{$commit.Summary | RenderEmoji}} {{TimeSince $commit.Committer.When $.Lang}}