Skip to content

Commit

Permalink
add back lazy loading attr
Browse files Browse the repository at this point in the history
  • Loading branch information
tjheffner committed Jan 21, 2024
1 parent 67d4c13 commit 3badaa6
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 3badaa6

Please sign in to comment.