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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3d82247613af647f6d7fbe2248fa838962d1978526a83e2d47332cae9ac8a6b
4
- data.tar.gz: 9ab2101a36a93705def90f856b05f0424b614dbfa4d81c1636842ffb0e12dba0
3
+ metadata.gz: fe2c846562262a36f629a2ef2f85fb3ded5c64468063d8b5bb23fe87193ad4bc
4
+ data.tar.gz: e38958119f562cc0a9e8048e4153b9617a4270be433b23f61a98ca8da7b6f893
5
5
  SHA512:
6
- metadata.gz: 0aa1105edf460b4531f1ab5fca822dff297763fd60b0fd0aff982858cf3e5d14fc6153da93bd709ffc33183e548ffb5a5064e19b8e0420ab98f9a69525f2e7ea
7
- data.tar.gz: 5fc8f884cb6b2abff9b11d392c1d50d3b73ffd9c842d17eba42d071ac23a6d58c50b8e3a0614a646d6120d850604a7ee75b1ce5bfcbe5d0bec7dcaedd3a20823
6
+ metadata.gz: 2c2016d43304a764d3fae7ebcd77114d58ef5397cdb5fb0fb58384edc330f40f63dfb2e0e5fbed3a877d1efdd19e685220401dc21b19b05067c217b9e4a4d912
7
+ data.tar.gz: 318fc9d378cfe82a9b0bec943e8edd16ec97ec59e55fe274d5f7025c285c14de086acb476cc4b12cce4be3dcb60e2e0dbabbf195bf2c4f0ab9f1c7119e5c5b87
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- builder_quill_content (0.1.5)
4
+ builder_quill_content (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -7,7 +7,7 @@ Welcome to your new gem! In this directory, you'll find the files you need to be
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'builder_quill_content'
10
+ gem 'builder_quill_content', '~> 0.1.6'
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -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/michaelt0520/builder_quill_content"
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
 
@@ -1,3 +1,3 @@
1
1
  module BuilderQuillContent
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -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| content += send(attr) }
17
+ @attributes.keys.each { |attr| @insert = send(attr) }
20
18
  else
21
- content = @insert.keys.first == 'wk-image' ? image : embed(@insert.keys.first)
19
+ @insert = @insert.keys.first == 'wk-image' ? image : embed(@insert.keys.first)
22
20
  end
23
21
 
24
- content
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.5
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/michaelt0520/builder_quill_content
33
+ homepage: https://github.com/1PACVietnam/wakuwaku-builder_quill_content
34
34
  licenses:
35
35
  - MIT
36
36
  metadata: {}