mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-06 17:40:57 +00:00
add lazy loading attribute to images
This commit is contained in:
parent
6d4554b01c
commit
cfeda81e2a
2 changed files with 4 additions and 0 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