contentful_converter 0.0.1.13 → 0.0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4af2afd7d0764a46305dea57d839478d7c424478c31beb7707a2e34c18a93815
4
- data.tar.gz: bb2172e979ebff1f518f9286653bf84d79437cc905220bf1da0148c4e45021a9
3
+ metadata.gz: b1237c1b023971ca2e44261d2f1bfbe0d6945ec4c857b212446a82785de4cbce
4
+ data.tar.gz: ceab77b90406545fabe458c82b2dcb242c47e4f87edb8136edfca25da787f999
5
5
  SHA512:
6
- metadata.gz: 96d859ac6abc2a91cf99b1a53f0dd87116612690eca93cd0c3f454c50f85f6ba34a4d9eb39a79db216b8ae4b6083d6e09e87aead1613044d677886e3bb379622
7
- data.tar.gz: a18b48a7d94854c67a89cfaf7cb103c5be8402c6c867e01e5743817665270ec3e88d3e631442f9cac02775c860b532d0ab5e5778b28fe81df4cac73dbd7e6e0a
6
+ metadata.gz: 23dc5e0c24d82fea3dc3588862f70c25bd7ba3aa9feb66fca8728e1b50a652cc56ea69ed1328bfdb050e4d27c4a23977741b41a46703205bc7fc005648d51629
7
+ data.tar.gz: 6517391e888f88dc67a799aecf914acd76f9e759402a9929405c454a03ba4741628948515fbbe578b349d7720e7c4cc360407ae9e6238bd0b0863d70beed70b0
data/README.md CHANGED
@@ -132,10 +132,11 @@ ContentfulConverter.convert('<h3>hello world</h3>')
132
132
  }
133
133
  ```
134
134
 
135
- **`<embed />`**
135
+ **`<embed />` AND `<img />`**
136
136
 
137
137
  If you want to add an embedded entry block, you need to create an `<embed>` element in HTML
138
- with src as the entry ID and type for the entry type.
138
+ with src and type attributes, for ID and entry type. Images will be converted into
139
+ embedded-asset-blocks by default and the src will be used as an ID.
139
140
 
140
141
  * Embedded Entry block: `<embed src="id_of_your_entry_123" type="entry"/>`
141
142
  ```ruby
@@ -155,6 +156,7 @@ with src as the entry ID and type for the entry type.
155
156
  ```
156
157
 
157
158
  * Embedded Asset block: `<embed src="id_of_your_entry_123" type="asset"/>`
159
+ Images: `<img src='id_of_your_entry_123' />`
158
160
  ```ruby
159
161
  {
160
162
  data: {
@@ -38,6 +38,7 @@ module ContentfulConverter
38
38
  'br' => Nodes::Paragraph,
39
39
  'section' => Nodes::Paragraph,
40
40
  'embed' => Nodes::Embed,
41
+ 'img' => Nodes::Embed,
41
42
  'hr' => Nodes::HorizontalLine,
42
43
  'blockquote' => Nodes::Blockquote,
43
44
  'ul' => Nodes::UnorderedList,
@@ -21,11 +21,11 @@ module ContentfulConverter
21
21
  end
22
22
 
23
23
  def options
24
- hyperlink_entry_option(type_value.capitalize)
24
+ hyperlink_entry_option(type_value.to_s.capitalize)
25
25
  end
26
26
 
27
27
  def type_value
28
- nokogiri_node[:type] || raise('Embed element requires a type')
28
+ nokogiri_node[:type] || :asset
29
29
  end
30
30
 
31
31
  def parsed_link
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentfulConverter
4
- VERSION = '0.0.1.13'
4
+ VERSION = '0.0.1.14'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.13
4
+ version: 0.0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Avlonitis