diff options
author | Eekle <96976531+Eekle@users.noreply.github.com> | 2022-05-18 22:36:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-18 23:36:49 +0200 |
commit | 260a28d8d59b7402653799ef1370f3641483940f (patch) | |
tree | f2e29c0c3d9fecb2f8a60c598e6536d5519a99e5 | |
parent | 6a052fba05ab6f38d45d11c896290f90fef17006 (diff) | |
download | gitea-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.go | 3 |
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) |