File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ import (
99 "html/template"
1010 "net/http"
1111 "strconv"
12+ "strings"
1213
1314 issues_model "code.gitea.io/gitea/models/issues"
1415 "code.gitea.io/gitea/models/renderhelper"
1516 user_model "code.gitea.io/gitea/models/user"
1617 "code.gitea.io/gitea/modules/git"
1718 "code.gitea.io/gitea/modules/gitrepo"
19+ "code.gitea.io/gitea/modules/htmlutil"
1820 "code.gitea.io/gitea/modules/log"
1921 "code.gitea.io/gitea/modules/markup/markdown"
2022 repo_module "code.gitea.io/gitea/modules/repository"
@@ -287,9 +289,10 @@ func UpdateCommentContent(ctx *context.Context) {
287289 ctx .ServerError ("RenderString" , err )
288290 return
289291 }
290- } else {
291- contentEmpty := fmt .Sprintf (`<span class="no-content">%s</span>` , ctx .Tr ("repo.issues.no_content" ))
292- renderedContent = template .HTML (contentEmpty )
292+ }
293+
294+ if strings .TrimSpace (string (renderedContent )) == "" {
295+ renderedContent = htmlutil .HTMLFormat (`<span class="no-content">%s</span>` , ctx .Tr ("repo.issues.no_content" ))
293296 }
294297
295298 ctx .JSON (http .StatusOK , map [string ]any {
Original file line number Diff line number Diff line change 168168{{template "repo/issue/view_content/reference_issue_dialog" .}}
169169{{template "shared/user/block_user_dialog" .}}
170170
171- <div class="tw-hidden" id="no-content">
172- <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
173- </div>
174-
175171<div class="ui g-modal-confirm delete modal">
176172 <div class="header">
177173 {{svg "octicon-trash"}}
You can’t perform that action at this time.
0 commit comments