Only add loading=lazy if I didn't already specify it on the img.

This commit is contained in:
voussoir 2022-04-07 11:41:14 -07:00
parent ec38f1a47a
commit aaa7a9bdb1
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -654,6 +654,7 @@ def inject_footnotes(soup):
def set_img_lazyload(soup): def set_img_lazyload(soup):
imgs = soup.find_all('img') imgs = soup.find_all('img')
for img in imgs: for img in imgs:
if not img.get('loading'):
img['loading'] = 'lazy' img['loading'] = 'lazy'
# FINAL MARKDOWNS # FINAL MARKDOWNS