Skip to content

Commit 260a28d

Browse files
Eekledelvh
andauthored
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 <[email protected]>
1 parent 6a052fb commit 260a28d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

models/issue_xref.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,9 @@ func CommentTypeIsRef(t CommentType) bool {
295295

296296
// RefCommentHTMLURL returns the HTML URL for the comment that created this reference
297297
func (comment *Comment) RefCommentHTMLURL() string {
298+
// Edge case for when the reference is inside the title or the description of the referring issue
298299
if comment.RefCommentID == 0 {
299-
return ""
300+
return comment.RefIssueHTMLURL()
300301
}
301302
if err := comment.LoadRefComment(); err != nil { // Silently dropping errors :unamused:
302303
log.Error("LoadRefComment(%d): %v", comment.RefCommentID, err)

0 commit comments

Comments
 (0)