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.

fix: revert issue rendering for `<a>` element (#7171)

- Issue title rendering can lead to nested `<a>` which is incorrect. So
revert a portion of forgejo/forgejo#6715.
- Integration test adjusted
- Resolves forgejo/forgejo#7076

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7171
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>

authored by

Gusted
Gusted
and committed by
Gusted
9073ca81 140b28b6

+6 -2
+1 -1
templates/user/dashboard/feeds.tmpl
··· 107 107 {{else if .GetOpType.InActions "create_pull_request"}} 108 108 <span class="text truncate issue title">{{RenderIssueTitle ctx (index .GetIssueInfos 1) (.Repo.ComposeMetas ctx)}}</span> 109 109 {{else if .GetOpType.InActions "comment_issue" "approve_pull_request" "reject_pull_request" "comment_pull"}} 110 - <a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{RenderIssueTitle ctx (.GetIssueTitle ctx) (.Repo.ComposeMetas ctx)}}</a> 110 + <a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</a> 111 111 {{$comment := index .GetIssueInfos 1}} 112 112 {{if $comment}} 113 113 <div class="markup tw-text-14">{{RenderMarkdownToHtml ctx $comment}}</div>
+5 -1
tests/integration/user_dashboard_test.go
··· 92 92 count := 0 93 93 htmlDoc.doc.Find("#activity-feed .flex-item-main .title").Each(func(i int, s *goquery.Selection) { 94 94 count++ 95 - assert.EqualValues(t, ":exclamation: not rendered", s.Text()) 95 + if s.IsMatcher(goquery.Single("a")) { 96 + assert.EqualValues(t, "❗ not rendered", s.Text()) 97 + } else { 98 + assert.EqualValues(t, ":exclamation: not rendered", s.Text()) 99 + } 96 100 }) 97 101 98 102 assert.EqualValues(t, 6, count)