mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-04 17:35:21 +02:00
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:
parent
2bca029f6f
commit
7ab27a7a7f
10 changed files with 67 additions and 59 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue