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>
tokarchuk/v1.17
Eekle 3 years ago committed by GitHub
parent 6a052fba05
commit 260a28d8d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      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)

Loading…
Cancel
Save