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>
This commit is contained in:
parent
140b28b60d
commit
9073ca8128
|
@ -107,7 +107,7 @@
|
||||||
{{else if .GetOpType.InActions "create_pull_request"}}
|
{{else if .GetOpType.InActions "create_pull_request"}}
|
||||||
<span class="text truncate issue title">{{RenderIssueTitle ctx (index .GetIssueInfos 1) (.Repo.ComposeMetas ctx)}}</span>
|
<span class="text truncate issue title">{{RenderIssueTitle ctx (index .GetIssueInfos 1) (.Repo.ComposeMetas ctx)}}</span>
|
||||||
{{else if .GetOpType.InActions "comment_issue" "approve_pull_request" "reject_pull_request" "comment_pull"}}
|
{{else if .GetOpType.InActions "comment_issue" "approve_pull_request" "reject_pull_request" "comment_pull"}}
|
||||||
<a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{RenderIssueTitle ctx (.GetIssueTitle ctx) (.Repo.ComposeMetas ctx)}}</a>
|
<a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</a>
|
||||||
{{$comment := index .GetIssueInfos 1}}
|
{{$comment := index .GetIssueInfos 1}}
|
||||||
{{if $comment}}
|
{{if $comment}}
|
||||||
<div class="markup tw-text-14">{{RenderMarkdownToHtml ctx $comment}}</div>
|
<div class="markup tw-text-14">{{RenderMarkdownToHtml ctx $comment}}</div>
|
||||||
|
|
|
@ -92,7 +92,11 @@ func TestDashboardTitleRendering(t *testing.T) {
|
||||||
count := 0
|
count := 0
|
||||||
htmlDoc.doc.Find("#activity-feed .flex-item-main .title").Each(func(i int, s *goquery.Selection) {
|
htmlDoc.doc.Find("#activity-feed .flex-item-main .title").Each(func(i int, s *goquery.Selection) {
|
||||||
count++
|
count++
|
||||||
assert.EqualValues(t, ":exclamation: not rendered", s.Text())
|
if s.IsMatcher(goquery.Single("a")) {
|
||||||
|
assert.EqualValues(t, "❗ not rendered", s.Text())
|
||||||
|
} else {
|
||||||
|
assert.EqualValues(t, ":exclamation: not rendered", s.Text())
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.EqualValues(t, 6, count)
|
assert.EqualValues(t, 6, count)
|
||||||
|
|
Loading…
Reference in New Issue