Skip to content

Commit

Permalink
Merge pull request #94 from tjheffner/gallery-updates
Browse files Browse the repository at this point in the history
add back lazy loading attr
  • Loading branch information
tjheffner authored Jan 21, 2024
2 parents 55ad7ba + 3badaa6 commit 7f154b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/rehype-wrap-img.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export default function rehypeZoomImages(options = { selector: 'img' }) {
const wrapper = fromSelector('div.zoom ')
const label = fromSelector('label')
const checkbox = fromSelector('input[type="checkbox"]')

node.properties.loading = "lazy"

label.children = [checkbox, node]
wrapper.children = [label]
parent.children[i] = wrapper
Expand Down

0 comments on commit 7f154b0

Please sign in to comment.