mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-09 16:55:16 +00:00
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
|
@ -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