summaryrefslogtreecommitdiffstats
path: root/templates/user
diff options
context:
space:
mode:
authorYarden Shoham <hrsi88@gmail.com>2022-10-15 21:24:41 +0300
committerGitHub <noreply@github.com>2022-10-16 02:24:41 +0800
commitb9cd6fb70370b97496e03c61be35e0d3ceedc52d (patch)
tree954ec4f87da6f2de8405f2395cc2283ea49b722e /templates/user
parent671c609c465f02d7ac5023bb8491694a9f4768f5 (diff)
downloadgitea-b9cd6fb70370b97496e03c61be35e0d3ceedc52d.tar.gz
gitea-b9cd6fb70370b97496e03c61be35e0d3ceedc52d.zip
Add `code` highlighting in issue titles (#21432)
This changes the rendering logic of issue titles. If a substring in an issue title is enclosed with a pair of backticks, it'll be rendered with a monospace font (HTML `code` tag). * Closes #20887 Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'templates/user')
-rw-r--r--templates/user/dashboard/feeds.tmpl8
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl
index 1862f32b6b..94bbbc470a 100644
--- a/templates/user/dashboard/feeds.tmpl
+++ b/templates/user/dashboard/feeds.tmpl
@@ -99,17 +99,17 @@
</ul>
</div>
{{else if eq .GetOpType 6}}
- <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji}}</span>
+ <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji | RenderCodeBlock}}</span>
{{else if eq .GetOpType 7}}
- <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji}}</span>
+ <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji | RenderCodeBlock}}</span>
{{else if or (eq .GetOpType 10) (eq .GetOpType 21) (eq .GetOpType 22) (eq .GetOpType 23)}}
- <a href="{{.GetCommentLink}}" class="text truncate issue title">{{.GetIssueTitle | RenderEmoji}}</a>
+ <a href="{{.GetCommentLink}}" class="text truncate issue title">{{.GetIssueTitle | RenderEmoji | RenderCodeBlock}}</a>
{{$comment := index .GetIssueInfos 1}}
{{if gt (len $comment) 0}}<p class="text light grey">{{$comment | RenderEmoji}}</p>{{end}}
{{else if eq .GetOpType 11}}
<p class="text light grey">{{index .GetIssueInfos 1}}</p>
{{else if or (eq .GetOpType 12) (eq .GetOpType 13) (eq .GetOpType 14) (eq .GetOpType 15)}}
- <span class="text truncate issue title">{{.GetIssueTitle | RenderEmoji}}</span>
+ <span class="text truncate issue title">{{.GetIssueTitle | RenderEmoji | RenderCodeBlock}}</span>
{{else if eq .GetOpType 25}}
<p class="text light grey">{{$.locale.Tr "action.review_dismissed_reason"}}</p>
<p class="text light grey">{{index .GetIssueInfos 2 | RenderEmoji}}</p>