loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request '[BUG] Render references to cross-repo issues with external issues' (#4860) from gusted/forgejo-ref-on-external into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4860
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>

+17 -1
+1 -1
modules/markup/html.go
··· 867 867 868 868 var link *html.Node 869 869 reftext := node.Data[ref.RefLocation.Start:ref.RefLocation.End] 870 - if hasExtTrackFormat && !ref.IsPull { 870 + if hasExtTrackFormat && !ref.IsPull && ref.Owner == "" { 871 871 ctx.Metas["index"] = ref.Issue 872 872 873 873 res, err := vars.Expand(ctx.Metas["format"], ctx.Metas)
+16
modules/markup/html_internal_test.go
··· 342 342 test(tmp, "<a href=\""+tmp+"\" class=\"commit\"><code class=\"nohighlight\">d8a994ef24 (diff-2)</code></a>") 343 343 } 344 344 345 + func TestRender_IssueIndexPatternRef(t *testing.T) { 346 + setting.AppURL = TestAppURL 347 + 348 + test := func(input, expected string) { 349 + var buf strings.Builder 350 + err := postProcess(&RenderContext{ 351 + Ctx: git.DefaultContext, 352 + Metas: numericMetas, 353 + }, []processor{issueIndexPatternProcessor}, strings.NewReader(input), &buf) 354 + require.NoError(t, err) 355 + assert.Equal(t, expected, buf.String(), "input=%q", input) 356 + } 357 + 358 + test("alan-turin/Enigma-cryptanalysis#1", `<a href="/alan-turin/enigma-cryptanalysis/issues/1" class="ref-issue">alan-turin/Enigma-cryptanalysis#1</a>`) 359 + } 360 + 345 361 func TestRender_FullIssueURLs(t *testing.T) { 346 362 setting.AppURL = TestAppURL 347 363