From f028f45d8e330cbcbd7ffe0509d80d8ca76d2d2c Mon Sep 17 00:00:00 2001 From: charles7668 Date: Fri, 6 Jun 2025 23:23:01 +0800 Subject: [PATCH 1/7] Fix footnote jump behavior on the issue page. --- modules/markup/html.go | 1 + modules/markup/html_issue_test.go | 19 +++++++++++++++++++ modules/markup/html_node.go | 20 ++++++++++++++++++++ routers/web/repo/issue_view.go | 4 ++++ 4 files changed, 44 insertions(+) diff --git a/modules/markup/html.go b/modules/markup/html.go index 7c3bd936999f2..9a1adc00ab2a0 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -320,6 +320,7 @@ func visitNode(ctx *RenderContext, procs []processor, node *html.Node) *html.Nod } processNodeAttrID(node) + processFootnoteNode(ctx, node) if isEmojiNode(node) { // TextNode emoji will be converted to ``, then the next iteration will visit the "span" diff --git a/modules/markup/html_issue_test.go b/modules/markup/html_issue_test.go index c68429641f7b5..7d3e46b390fe8 100644 --- a/modules/markup/html_issue_test.go +++ b/modules/markup/html_issue_test.go @@ -30,6 +30,7 @@ func TestRender_IssueList(t *testing.T) { rctx := markup.NewTestRenderContext(markup.TestAppURL, map[string]string{ "user": "test-user", "repo": "test-repo", "markupAllowShortIssuePattern": "true", + "issue_comment_id": "12345", }) out, err := markdown.RenderString(rctx, input) require.NoError(t, err) @@ -69,4 +70,22 @@ func TestRender_IssueList(t *testing.T) { `, ) }) + + t.Run("IssueFootnote", func(t *testing.T) { + test( + "foo[^1][^2]\n\n[^1]: bar\n[^2]: baz", + `

foo12

+
+
+
    +
  1. +

    bar ↩︎

    +
  2. +
  3. +

    baz ↩︎

    +
  4. +
+
`, + ) + }) } diff --git a/modules/markup/html_node.go b/modules/markup/html_node.go index 68858b024af0d..38b1dc74c862a 100644 --- a/modules/markup/html_node.go +++ b/modules/markup/html_node.go @@ -15,6 +15,14 @@ func isAnchorIDUserContent(s string) bool { return strings.HasPrefix(s, "user-content-") || strings.Contains(s, ":user-content-") } +func isAnchorIDFootnote(s string) bool { + return strings.HasPrefix(s, "fnref:user-content-") || strings.HasPrefix(s, "fn:user-content-") +} + +func isAnchorHrefFootnote(s string) bool { + return strings.HasPrefix(s, "#fnref:user-content-") || strings.HasPrefix(s, "#fn:user-content-") +} + func processNodeAttrID(node *html.Node) { // Add user-content- to IDs and "#" links if they don't already have them, // and convert the link href to a relative link to the host root @@ -27,6 +35,18 @@ func processNodeAttrID(node *html.Node) { } } +func processFootnoteNode(ctx *RenderContext, node *html.Node) { + for idx, attr := range node.Attr { + if (attr.Key == "id" && isAnchorIDFootnote(attr.Val)) || + (attr.Key == "href" && isAnchorHrefFootnote(attr.Val)) { + if issueNum, ok := ctx.RenderOptions.Metas["issue_comment_id"]; ok { + node.Attr[idx].Val = attr.Val + "-" + issueNum + } + continue + } + } +} + func processNodeA(ctx *RenderContext, node *html.Node) { for idx, attr := range node.Attr { if attr.Key == "href" { diff --git a/routers/web/repo/issue_view.go b/routers/web/repo/issue_view.go index 13b9d83da42d0..5304b2cbdfc36 100644 --- a/routers/web/repo/issue_view.go +++ b/routers/web/repo/issue_view.go @@ -9,6 +9,7 @@ import ( "net/http" "net/url" "sort" + "strconv" activities_model "code.gitea.io/gitea/models/activities" "code.gitea.io/gitea/models/db" @@ -625,6 +626,7 @@ func prepareIssueViewCommentsAndSidebarParticipants(ctx *context.Context, issue if comment.Type == issues_model.CommentTypeComment || comment.Type == issues_model.CommentTypeReview { rctx := renderhelper.NewRenderContextRepoComment(ctx, issue.Repo) + rctx.RenderOptions.Metas["issue_comment_id"] = strconv.FormatInt(comment.ID, 10) comment.RenderedContent, err = markdown.RenderString(rctx, comment.Content) if err != nil { ctx.ServerError("RenderString", err) @@ -982,6 +984,8 @@ func preparePullViewReviewAndMerge(ctx *context.Context, issue *issues_model.Iss func prepareIssueViewContent(ctx *context.Context, issue *issues_model.Issue) { var err error rctx := renderhelper.NewRenderContextRepoComment(ctx, ctx.Repo.Repository) + // the first issue index set to 0 + rctx.RenderOptions.Metas["issue_comment_id"] = "0" issue.RenderedContent, err = markdown.RenderString(rctx, issue.Content) if err != nil { ctx.ServerError("RenderString", err) From f8de6b059b8568b3198626db1d433f7ec047ddcd Mon Sep 17 00:00:00 2001 From: charles7668 Date: Sat, 7 Jun 2025 10:34:33 +0800 Subject: [PATCH 2/7] Fix JavaScript error when clicking a footnote link. --- web_src/js/markup/anchors.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_src/js/markup/anchors.ts b/web_src/js/markup/anchors.ts index 483d72bd5b94f..1eed1c738cf53 100644 --- a/web_src/js/markup/anchors.ts +++ b/web_src/js/markup/anchors.ts @@ -6,7 +6,8 @@ const hasPrefix = (str: string): boolean => str.startsWith('user-content-'); // scroll to anchor while respecting the `user-content` prefix that exists on the target function scrollToAnchor(encodedId: string): void { - if (!encodedId) return; + // Ignore the footnote case, as the link is rendered by the backend. + if (!encodedId || encodedId.startsWith('fn:') || encodedId.startsWith('fnref:')) return; const id = decodeURIComponent(encodedId); const prefixedId = addPrefix(id); let el = document.querySelector(`#${prefixedId}`); From 01873b6ce4b94a54f582fb805a17ce0dec50e651 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 9 Jun 2025 14:49:55 +0800 Subject: [PATCH 3/7] refactor --- models/renderhelper/repo_comment.go | 3 +++ modules/markup/html_issue_test.go | 2 +- modules/markup/html_node.go | 4 ++-- routers/web/repo/issue_view.go | 11 ++++++----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/models/renderhelper/repo_comment.go b/models/renderhelper/repo_comment.go index 7c40eded4445b..1f50ebfe20c56 100644 --- a/models/renderhelper/repo_comment.go +++ b/models/renderhelper/repo_comment.go @@ -44,6 +44,7 @@ type RepoCommentOptions struct { DeprecatedRepoName string // it is only a patch for the non-standard "markup" api DeprecatedOwnerName string // it is only a patch for the non-standard "markup" api CurrentRefPath string // eg: "branch/main" or "commit/11223344" + FootnoteContextID string // the extra context ID for footnotes, used to avoid conflicts with other footnotes in the same page } func NewRenderContextRepoComment(ctx context.Context, repo *repo_model.Repository, opts ...RepoCommentOptions) *markup.RenderContext { @@ -66,6 +67,8 @@ func NewRenderContextRepoComment(ctx context.Context, repo *repo_model.Repositor "markdownNewLineHardBreak": "true", "markupAllowShortIssuePattern": "true", + + "footnoteContextId": helper.opts.FootnoteContextID, }) } rctx = rctx.WithHelper(helper) diff --git a/modules/markup/html_issue_test.go b/modules/markup/html_issue_test.go index 7d3e46b390fe8..92e647eaedc27 100644 --- a/modules/markup/html_issue_test.go +++ b/modules/markup/html_issue_test.go @@ -30,7 +30,7 @@ func TestRender_IssueList(t *testing.T) { rctx := markup.NewTestRenderContext(markup.TestAppURL, map[string]string{ "user": "test-user", "repo": "test-repo", "markupAllowShortIssuePattern": "true", - "issue_comment_id": "12345", + "footnoteContextId": "12345", }) out, err := markdown.RenderString(rctx, input) require.NoError(t, err) diff --git a/modules/markup/html_node.go b/modules/markup/html_node.go index 38b1dc74c862a..087be24bfd5db 100644 --- a/modules/markup/html_node.go +++ b/modules/markup/html_node.go @@ -39,8 +39,8 @@ func processFootnoteNode(ctx *RenderContext, node *html.Node) { for idx, attr := range node.Attr { if (attr.Key == "id" && isAnchorIDFootnote(attr.Val)) || (attr.Key == "href" && isAnchorHrefFootnote(attr.Val)) { - if issueNum, ok := ctx.RenderOptions.Metas["issue_comment_id"]; ok { - node.Attr[idx].Val = attr.Val + "-" + issueNum + if footnoteContextID, ok := ctx.RenderOptions.Metas["footnoteContextId"]; ok { + node.Attr[idx].Val = attr.Val + "-" + footnoteContextID } continue } diff --git a/routers/web/repo/issue_view.go b/routers/web/repo/issue_view.go index 5304b2cbdfc36..58230320affb7 100644 --- a/routers/web/repo/issue_view.go +++ b/routers/web/repo/issue_view.go @@ -625,8 +625,9 @@ func prepareIssueViewCommentsAndSidebarParticipants(ctx *context.Context, issue comment.Issue = issue if comment.Type == issues_model.CommentTypeComment || comment.Type == issues_model.CommentTypeReview { - rctx := renderhelper.NewRenderContextRepoComment(ctx, issue.Repo) - rctx.RenderOptions.Metas["issue_comment_id"] = strconv.FormatInt(comment.ID, 10) + rctx := renderhelper.NewRenderContextRepoComment(ctx, issue.Repo, renderhelper.RepoCommentOptions{ + FootnoteContextID: strconv.FormatInt(comment.ID, 10), + }) comment.RenderedContent, err = markdown.RenderString(rctx, comment.Content) if err != nil { ctx.ServerError("RenderString", err) @@ -983,9 +984,9 @@ func preparePullViewReviewAndMerge(ctx *context.Context, issue *issues_model.Iss func prepareIssueViewContent(ctx *context.Context, issue *issues_model.Issue) { var err error - rctx := renderhelper.NewRenderContextRepoComment(ctx, ctx.Repo.Repository) - // the first issue index set to 0 - rctx.RenderOptions.Metas["issue_comment_id"] = "0" + rctx := renderhelper.NewRenderContextRepoComment(ctx, ctx.Repo.Repository, renderhelper.RepoCommentOptions{ + FootnoteContextID: "0", // Set footnote context ID to 0 for the issue content + }) issue.RenderedContent, err = markdown.RenderString(rctx, issue.Content) if err != nil { ctx.ServerError("RenderString", err) From f0e3dd0c578ab59989e102e31065f4c04496ddf2 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 9 Jun 2025 15:02:06 +0800 Subject: [PATCH 4/7] refactor --- modules/markup/html.go | 2 +- web_src/js/markup/anchors.ts | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/markup/html.go b/modules/markup/html.go index 9a1adc00ab2a0..d45153d95b85f 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -320,7 +320,7 @@ func visitNode(ctx *RenderContext, procs []processor, node *html.Node) *html.Nod } processNodeAttrID(node) - processFootnoteNode(ctx, node) + processFootnoteNode(ctx, node) // FIXME: the footnote processing should be done in the "footnote.go" renderer directly if isEmojiNode(node) { // TextNode emoji will be converted to ``, then the next iteration will visit the "span" diff --git a/web_src/js/markup/anchors.ts b/web_src/js/markup/anchors.ts index 1eed1c738cf53..6023bf9dbee8d 100644 --- a/web_src/js/markup/anchors.ts +++ b/web_src/js/markup/anchors.ts @@ -5,22 +5,24 @@ const removePrefix = (str: string): string => str.replace(/^user-content-/, ''); const hasPrefix = (str: string): boolean => str.startsWith('user-content-'); // scroll to anchor while respecting the `user-content` prefix that exists on the target -function scrollToAnchor(encodedId: string): void { - // Ignore the footnote case, as the link is rendered by the backend. - if (!encodedId || encodedId.startsWith('fn:') || encodedId.startsWith('fnref:')) return; - const id = decodeURIComponent(encodedId); - const prefixedId = addPrefix(id); - let el = document.querySelector(`#${prefixedId}`); +function scrollToAnchor(encodedId?: string): void { + // FIXME: need to rewrite this function with new a better "footnote.go" logic, too many tricks here + let elemId: string; + try { + elemId = decodeURIComponent(encodedId ?? ''); + } catch {} // ignore the errors, since the "encodedId" is from user's input + if (!elemId) return; + + const prefixedId = addPrefix(elemId); + // eslint-disable-next-line unicorn/prefer-query-selector + let el = document.getElementById(prefixedId); // check for matching user-generated `a[name]` - if (!el) { - el = document.querySelector(`a[name="${CSS.escape(prefixedId)}"]`); - } + el = el ?? document.querySelector(`a[name="${CSS.escape(prefixedId)}"]`); // compat for links with old 'user-content-' prefixed hashes - if (!el && hasPrefix(id)) { - return document.querySelector(`#${id}`)?.scrollIntoView(); - } + // eslint-disable-next-line unicorn/prefer-query-selector + el = (!el && hasPrefix(elemId)) ? document.getElementById(elemId) : el; el?.scrollIntoView(); } From cab554b2120fb60614256cef177cfc19cd7365bd Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 9 Jun 2025 15:18:53 +0800 Subject: [PATCH 5/7] fix more --- models/issues/comment_code.go | 5 ++++- models/renderhelper/repo_comment.go | 8 ++++---- modules/markup/common/footnote.go | 4 ++-- modules/markup/html_node.go | 2 +- routers/common/markup.go | 6 +++++- routers/web/repo/issue.go | 4 +++- routers/web/repo/issue_comment.go | 5 ++++- routers/web/repo/issue_view.go | 4 +++- routers/web/repo/release.go | 5 ++++- 9 files changed, 30 insertions(+), 13 deletions(-) diff --git a/models/issues/comment_code.go b/models/issues/comment_code.go index b562aab5005f6..55e67a1243b70 100644 --- a/models/issues/comment_code.go +++ b/models/issues/comment_code.go @@ -5,6 +5,7 @@ package issues import ( "context" + "strconv" "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/renderhelper" @@ -114,7 +115,9 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu } var err error - rctx := renderhelper.NewRenderContextRepoComment(ctx, issue.Repo) + rctx := renderhelper.NewRenderContextRepoComment(ctx, issue.Repo, renderhelper.RepoCommentOptions{ + FootnoteContextID: strconv.FormatInt(comment.ID, 10), + }) if comment.RenderedContent, err = markdown.RenderString(rctx, comment.Content); err != nil { return nil, err } diff --git a/models/renderhelper/repo_comment.go b/models/renderhelper/repo_comment.go index 1f50ebfe20c56..a400f7b908a0f 100644 --- a/models/renderhelper/repo_comment.go +++ b/models/renderhelper/repo_comment.go @@ -54,10 +54,11 @@ func NewRenderContextRepoComment(ctx context.Context, repo *repo_model.Repositor } rctx := markup.NewRenderContext(ctx) helper.ctx = rctx + var metas map[string]string if repo != nil { helper.repoLink = repo.Link() helper.commitChecker = newCommitChecker(ctx, repo) - rctx = rctx.WithMetas(repo.ComposeCommentMetas(ctx)) + metas = repo.ComposeCommentMetas(ctx) } else { // this is almost dead code, only to pass the incorrect tests helper.repoLink = fmt.Sprintf("%s/%s", helper.opts.DeprecatedOwnerName, helper.opts.DeprecatedRepoName) @@ -67,10 +68,9 @@ func NewRenderContextRepoComment(ctx context.Context, repo *repo_model.Repositor "markdownNewLineHardBreak": "true", "markupAllowShortIssuePattern": "true", - - "footnoteContextId": helper.opts.FootnoteContextID, }) } - rctx = rctx.WithHelper(helper) + metas["footnoteContextId"] = helper.opts.FootnoteContextID + rctx = rctx.WithMetas(metas).WithHelper(helper) return rctx } diff --git a/modules/markup/common/footnote.go b/modules/markup/common/footnote.go index 9a4f18ed7f5a4..26ab60bc1e39e 100644 --- a/modules/markup/common/footnote.go +++ b/modules/markup/common/footnote.go @@ -409,9 +409,9 @@ func (r *FootnoteHTMLRenderer) renderFootnoteLink(w util.BufWriter, source []byt _, _ = w.Write(n.Name) _, _ = w.WriteString(`">`) + _, _ = w.WriteString(`" class="footnote-ref" role="doc-noteref">`) // FIXME: here and below, need to keep the classes _, _ = w.WriteString(is) - _, _ = w.WriteString(``) + _, _ = w.WriteString(` `) // the style doesn't work at the moment, so add a space to separate the names } return ast.WalkContinue, nil } diff --git a/modules/markup/html_node.go b/modules/markup/html_node.go index 087be24bfd5db..f67437465cdf2 100644 --- a/modules/markup/html_node.go +++ b/modules/markup/html_node.go @@ -39,7 +39,7 @@ func processFootnoteNode(ctx *RenderContext, node *html.Node) { for idx, attr := range node.Attr { if (attr.Key == "id" && isAnchorIDFootnote(attr.Val)) || (attr.Key == "href" && isAnchorHrefFootnote(attr.Val)) { - if footnoteContextID, ok := ctx.RenderOptions.Metas["footnoteContextId"]; ok { + if footnoteContextID := ctx.RenderOptions.Metas["footnoteContextId"]; footnoteContextID != "" { node.Attr[idx].Val = attr.Val + "-" + footnoteContextID } continue diff --git a/routers/common/markup.go b/routers/common/markup.go index 4c77ff33ed88e..00b2dd07c64bb 100644 --- a/routers/common/markup.go +++ b/routers/common/markup.go @@ -76,7 +76,11 @@ func RenderMarkup(ctx *context.Base, ctxRepo *context.Repository, mode, text, ur }) rctx = rctx.WithMarkupType(markdown.MarkupName) case "comment": - rctx = renderhelper.NewRenderContextRepoComment(ctx, repoModel, renderhelper.RepoCommentOptions{DeprecatedOwnerName: repoOwnerName, DeprecatedRepoName: repoName}) + rctx = renderhelper.NewRenderContextRepoComment(ctx, repoModel, renderhelper.RepoCommentOptions{ + DeprecatedOwnerName: repoOwnerName, + DeprecatedRepoName: repoName, + FootnoteContextID: "preview", + }) rctx = rctx.WithMarkupType(markdown.MarkupName) case "wiki": rctx = renderhelper.NewRenderContextRepoWiki(ctx, repoModel, renderhelper.RepoWikiOptions{DeprecatedOwnerName: repoOwnerName, DeprecatedRepoName: repoName}) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index e70e8fdd7b223..a4747964c6f02 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -364,7 +364,9 @@ func UpdateIssueContent(ctx *context.Context) { } } - rctx := renderhelper.NewRenderContextRepoComment(ctx, ctx.Repo.Repository) + rctx := renderhelper.NewRenderContextRepoComment(ctx, ctx.Repo.Repository, renderhelper.RepoCommentOptions{ + FootnoteContextID: "0", + }) content, err := markdown.RenderString(rctx, issue.Content) if err != nil { ctx.ServerError("RenderString", err) diff --git a/routers/web/repo/issue_comment.go b/routers/web/repo/issue_comment.go index 9b51999fbde6c..c2a7f6b6822db 100644 --- a/routers/web/repo/issue_comment.go +++ b/routers/web/repo/issue_comment.go @@ -8,6 +8,7 @@ import ( "fmt" "html/template" "net/http" + "strconv" issues_model "code.gitea.io/gitea/models/issues" "code.gitea.io/gitea/models/renderhelper" @@ -278,7 +279,9 @@ func UpdateCommentContent(ctx *context.Context) { var renderedContent template.HTML if comment.Content != "" { - rctx := renderhelper.NewRenderContextRepoComment(ctx, ctx.Repo.Repository) + rctx := renderhelper.NewRenderContextRepoComment(ctx, ctx.Repo.Repository, renderhelper.RepoCommentOptions{ + FootnoteContextID: strconv.FormatInt(comment.ID, 10), + }) renderedContent, err = markdown.RenderString(rctx, comment.Content) if err != nil { ctx.ServerError("RenderString", err) diff --git a/routers/web/repo/issue_view.go b/routers/web/repo/issue_view.go index 58230320affb7..88eb65c5aabee 100644 --- a/routers/web/repo/issue_view.go +++ b/routers/web/repo/issue_view.go @@ -703,7 +703,9 @@ func prepareIssueViewCommentsAndSidebarParticipants(ctx *context.Context, issue } } } else if comment.Type.HasContentSupport() { - rctx := renderhelper.NewRenderContextRepoComment(ctx, issue.Repo) + rctx := renderhelper.NewRenderContextRepoComment(ctx, issue.Repo, renderhelper.RepoCommentOptions{ + FootnoteContextID: strconv.FormatInt(comment.ID, 10), + }) comment.RenderedContent, err = markdown.RenderString(rctx, comment.Content) if err != nil { ctx.ServerError("RenderString", err) diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go index 2baf434e75d0b..8e586adde9ab5 100644 --- a/routers/web/repo/release.go +++ b/routers/web/repo/release.go @@ -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 From 07ab5956b3a72956a29d33e6d1f5bb5f3bdb41ed Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 9 Jun 2025 15:20:37 +0800 Subject: [PATCH 6/7] fix comment --- web_src/js/markup/anchors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/markup/anchors.ts b/web_src/js/markup/anchors.ts index 6023bf9dbee8d..a0d49911febf2 100644 --- a/web_src/js/markup/anchors.ts +++ b/web_src/js/markup/anchors.ts @@ -6,7 +6,7 @@ const hasPrefix = (str: string): boolean => str.startsWith('user-content-'); // scroll to anchor while respecting the `user-content` prefix that exists on the target function scrollToAnchor(encodedId?: string): void { - // FIXME: need to rewrite this function with new a better "footnote.go" logic, too many tricks here + // FIXME: need to rewrite this function with new a better markup anchor generation logic, too many tricks here let elemId: string; try { elemId = decodeURIComponent(encodedId ?? ''); From 7c4537d719b48bca0f6e6812c0d92fd3b2c1c8f2 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 9 Jun 2025 21:06:32 +0800 Subject: [PATCH 7/7] fix test --- modules/markup/html_issue_test.go | 2 +- modules/markup/markdown/markdown_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/markup/html_issue_test.go b/modules/markup/html_issue_test.go index 92e647eaedc27..39cd9dcf6af88 100644 --- a/modules/markup/html_issue_test.go +++ b/modules/markup/html_issue_test.go @@ -74,7 +74,7 @@ func TestRender_IssueList(t *testing.T) { t.Run("IssueFootnote", func(t *testing.T) { test( "foo[^1][^2]\n\n[^1]: bar\n[^2]: baz", - `

foo12

+ `

foo1 2


    diff --git a/modules/markup/markdown/markdown_test.go b/modules/markup/markdown/markdown_test.go index 2310895fc3bee..99f590c950aa4 100644 --- a/modules/markup/markdown/markdown_test.go +++ b/modules/markup/markdown/markdown_test.go @@ -223,7 +223,7 @@ This PR has been generated by [Renovate Bot](https://github.com/renovatebot/reno
    This is another definition of the second term.

    Footnotes

    -

    Here is a simple footnote,1 and here is a longer one.2

    +

    Here is a simple footnote,1 and here is a longer one.2