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 +4 -4
- data/lib/asciidoctor-lazy-images/extension.rb +11 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc5cdc69fcc5ae72b5376f0a38f77133aa4e1f83140059ec06e2412e9cfb2ae7
|
4
|
+
data.tar.gz: 4a98a8dfff4f92d3b188fc9fe82713b8ead0f6d83e9c688e46a30add0fdb2519
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|