1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-07-31 07:29:40 +02:00

[v11.0/forgejo] fix(ui): add missing lazy load attribute to images (#8246) (#8283)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8246

closes #8076

(cherry picked from commit 7ab27a7a7f)

Co-authored-by: Bente Groh <mail@bentegroh.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8283
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Beowulf 2025-06-26 01:02:41 +02:00
parent ca07340093
commit a4f6c07306
10 changed files with 67 additions and 59 deletions

View file

@ -44,6 +44,7 @@ func (g *ASTTransformer) transformImage(ctx *markup.RenderContext, v *ast.Image)
for _, attr := range v.Attributes() {
image.SetAttribute(attr.Name, attr.Value)
}
image.SetAttributeString("loading", []byte("lazy"))
for child := v.FirstChild(); child != nil; {
next := child.NextSibling()
image.AppendChild(image, child)