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>
This commit is contained in:
parent
6a052fba05
commit
260a28d8d5
1 changed files with 2 additions and 1 deletions
|
@ -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…
Reference in a new issue