fix(ui): add missing lazy load attribute to images (#8246)

closes #8076

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8246
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Bente Groh <mail@bentegroh.de>
Co-committed-by: Bente Groh <mail@bentegroh.de>
This commit is contained in:
Bente Groh 2025-06-25 18:31:03 +02:00 committed by Beowulf
commit 7ab27a7a7f
10 changed files with 67 additions and 59 deletions

View file

@ -75,6 +75,10 @@ func Test_Sanitizer(t *testing.T) {
// Emoji
`<span class="emoji" aria-label="thumbs up" data-alias="+1">THUMBS UP</span>`, `<span class="emoji" aria-label="thumbs up" data-alias="+1">THUMBS UP</span>`,
`<span class="emoji" aria-label="thumbs up" data-alias="(+!)">THUMBS UP</span>`, `<span class="emoji" aria-label="thumbs up">THUMBS UP</span>`,
// Images lazy loading
`<img src="/image1" alt="image1" loading="lazy">`, `<img src="/image1" alt="image1" loading="lazy">`,
`<img src="/image1" alt="image1" loading="eager">`, `<img src="/image1" alt="image1">`,
}
for i := 0; i < len(testCases); i += 2 {