asciidoctor-lazy-images 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae2d34b8fcb3028ed0fe80a8fd1e575d6ffd87ff1fb3e180e90893f2e7176798
4
- data.tar.gz: 4176f5e24a9a6b131c97e6133c23308ff9122049adbc745b55d238f0841bb322
3
+ metadata.gz: cc5cdc69fcc5ae72b5376f0a38f77133aa4e1f83140059ec06e2412e9cfb2ae7
4
+ data.tar.gz: 4a98a8dfff4f92d3b188fc9fe82713b8ead0f6d83e9c688e46a30add0fdb2519
5
5
  SHA512:
6
- metadata.gz: ecbb91c702380ff3c618bfec523d8c31e1d7ed51fccc2a85da8be6506af16eec9013a5a1732445ae0e7f44e4ffd336af8474f7b1d3e713d93495ea48951f9202
7
- data.tar.gz: dc0955f399408a9863bd2ca65171942e5b032d4e444a69c2d47d1a8c00e2312d6c30784fcd6c5e4b4c60373afcb121179d27662a9ddab5ca5a6d0a1adb405ecc
6
+ metadata.gz: 7ac5faf9e705dc5300c05e825c9f0d3c493b9a0902af52aa8c47b383b9c6e48ea6991dcb4ab4b926ddde9e4f878f053b4e4342c858180036f8e42a4df6607627
7
+ data.tar.gz: 13e18a0912738416906beb7ab63fbd3dbf2bd7f292d73a096781bd0f3ec2c000248f817315c80543b2682cf61e5d4e9a4aafaed62c0fb4e716f7b40b2765abf9
@@ -0,0 +1,11 @@
1
+ require 'asciidoctor/extensions'
2
+
3
+ class LazyImagePostprocessor < Asciidoctor::Extensions::Postprocessor
4
+ def process document, output
5
+ if document.basebackend? 'html'
6
+ replacement = %(<img loading=lazy )
7
+ output = output.gsub(/<img /, replacement)
8
+ end
9
+ output
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-lazy-images
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauville
@@ -17,6 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/asciidoctor-lazy-images.rb
20
+ - lib/asciidoctor-lazy-images/extension.rb
20
21
  homepage: https://www.github.com/Mauville/asciidoctor-lazy-images
21
22
  licenses:
22
23
  - MIT