builder_quill_content 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/builder_quill_content.gemspec +1 -1
- data/lib/builder_quill_content/version.rb +1 -1
- data/lib/convert_inline.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe2c846562262a36f629a2ef2f85fb3ded5c64468063d8b5bb23fe87193ad4bc
|
4
|
+
data.tar.gz: e38958119f562cc0a9e8048e4153b9617a4270be433b23f61a98ca8da7b6f893
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c2016d43304a764d3fae7ebcd77114d58ef5397cdb5fb0fb58384edc330f40f63dfb2e0e5fbed3a877d1efdd19e685220401dc21b19b05067c217b9e4a4d912
|
7
|
+
data.tar.gz: 318fc9d378cfe82a9b0bec943e8edd16ec97ec59e55fe274d5f7025c285c14de086acb476cc4b12cce4be3dcb60e2e0dbabbf195bf2c4f0ab9f1c7119e5c5b87
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.email = ["mictran205@gmail.com"]
|
8
8
|
|
9
9
|
spec.summary = "Convert quill content to html for wakuwaku"
|
10
|
-
spec.homepage = "https://github.com/
|
10
|
+
spec.homepage = "https://github.com/1PACVietnam/wakuwaku-builder_quill_content"
|
11
11
|
spec.license = "MIT"
|
12
12
|
# spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
13
|
|
data/lib/convert_inline.rb
CHANGED
@@ -13,15 +13,13 @@ class ConvertInline
|
|
13
13
|
def convert
|
14
14
|
return @insert if @insert.is_a?(String) && @attributes.nil?
|
15
15
|
|
16
|
-
content = ''
|
17
|
-
|
18
16
|
if @insert.is_a?(String)
|
19
|
-
@attributes.keys.each { |attr|
|
17
|
+
@attributes.keys.each { |attr| @insert = send(attr) }
|
20
18
|
else
|
21
|
-
|
19
|
+
@insert = @insert.keys.first == 'wk-image' ? image : embed(@insert.keys.first)
|
22
20
|
end
|
23
21
|
|
24
|
-
|
22
|
+
@insert
|
25
23
|
end
|
26
24
|
|
27
25
|
private
|
@@ -57,10 +55,12 @@ class ConvertInline
|
|
57
55
|
end
|
58
56
|
|
59
57
|
def image
|
60
|
-
img_src = @insert['wk-image']['src']
|
58
|
+
img_src = @insert['wk-image']['src'] || @attributes['src']
|
61
59
|
img_cap = @insert['wk-image']['caption']
|
62
60
|
img_alt = @attributes['alt']
|
63
61
|
|
62
|
+
return '' if img_src.nil?
|
63
|
+
|
64
64
|
'<figure class="post-content-image-container">
|
65
65
|
<img class="post-content-image lazy blur" data-src="' + img_src + '" alt="' + img_alt + '">
|
66
66
|
<figcaption class="post-image-caption u-text-center">' + img_cap + '</figcaption>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: builder_quill_content
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Tran
|
@@ -30,7 +30,7 @@ files:
|
|
30
30
|
- lib/builder_quill_content.rb
|
31
31
|
- lib/builder_quill_content/version.rb
|
32
32
|
- lib/convert_inline.rb
|
33
|
-
homepage: https://github.com/
|
33
|
+
homepage: https://github.com/1PACVietnam/wakuwaku-builder_quill_content
|
34
34
|
licenses:
|
35
35
|
- MIT
|
36
36
|
metadata: {}
|