summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEekle <96976531+Eekle@users.noreply.github.com>2022-05-18 22:36:49 +0100
committerGitHub <noreply@github.com>2022-05-18 23:36:49 +0200
commit260a28d8d59b7402653799ef1370f3641483940f (patch)
treef2e29c0c3d9fecb2f8a60c598e6536d5519a99e5
parent6a052fba05ab6f38d45d11c896290f90fef17006 (diff)
downloadgitea-260a28d8d59b7402653799ef1370f3641483940f.tar.gz
gitea-260a28d8d59b7402653799ef1370f3641483940f.zip
Improved ref comment link when origin is body/title (#19741)
* Makes comments in body text/title return the base page URL instead of "" in RefCommentHTMLURL() * Add comment explaining branch Co-authored-by: delvh <dev.lh@web.de>
-rw-r--r--models/issue_xref.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/issue_xref.go b/models/issue_xref.go
index c4f0080edd..3c9e67c3f8 100644
--- a/models/issue_xref.go
+++ b/models/issue_xref.go
@@ -295,8 +295,9 @@ func CommentTypeIsRef(t CommentType) bool {
// RefCommentHTMLURL returns the HTML URL for the comment that created this reference
func (comment *Comment) RefCommentHTMLURL() string {
+ // Edge case for when the reference is inside the title or the description of the referring issue
if comment.RefCommentID == 0 {
- return ""
+ return comment.RefIssueHTMLURL()
}
if err := comment.LoadRefComment(); err != nil { // Silently dropping errors :unamused:
log.Error("LoadRefComment(%d): %v", comment.RefCommentID, err)