Fix footnote jump behavior on the issue page. (#34621)

Close #34511 
Close #34590 

Add comment ID to the footnote item's id attribute to ensure uniqueness.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
charles
2025-06-10 01:18:11 +08:00
committed by GitHub
parent 9165ea8713
commit c6b2cbd75d
13 changed files with 92 additions and 24 deletions
+4 -1
View File
@@ -8,6 +8,7 @@ import (
"errors"
"fmt"
"net/http"
"strconv"
"strings"
"code.gitea.io/gitea/models/db"
@@ -113,7 +114,9 @@ func getReleaseInfos(ctx *context.Context, opts *repo_model.FindReleasesOptions)
cacheUsers[r.PublisherID] = r.Publisher
}
rctx := renderhelper.NewRenderContextRepoComment(ctx, r.Repo)
rctx := renderhelper.NewRenderContextRepoComment(ctx, r.Repo, renderhelper.RepoCommentOptions{
FootnoteContextID: strconv.FormatInt(r.ID, 10),
})
r.RenderedNote, err = markdown.RenderString(rctx, r.Note)
if err != nil {
return nil, err