editmode 1.3.0 → 1.3.1

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: 47cebfe121ea9d46b56bb12bbdc718a59ee3e7e0f877660552739ad775fec35b
4
- data.tar.gz: 152684b929650621c4bf6f52753685a9dbad4fcdc2fd96bddd2c8d3519f70eb0
3
+ metadata.gz: 392f282609e410c8656791b6120245b8b4c790ed8ba102d6dfe1c5d2062acd6f
4
+ data.tar.gz: 94246ddabf9aadcdf65ceab231e83a6704a7d89f39ce5039685b7f44ea4e18c9
5
5
  SHA512:
6
- metadata.gz: a4c3b2a41c5cd63436ad3ea98bec0635431d1bdf2d1554971c3576fdba7e4ac2e7defb3c0208b8d24744ee2e7dd8b9c37e09bf1d7bac5d47b3d9292c3b677f80
7
- data.tar.gz: 105fcf322d164e6ef2af9ca15a40a4339f34aa3eb427ebb9a1b5bdebb0523ea4919cea5a6bd6e48d67eb5b52ed7673691196e62087cd24cccb95e69f47c181fc
6
+ metadata.gz: 7a1f7f6442b1109fedbd94be59a08c0658d3aa6d9570a5e21f36a32da45c6befacdab23da75670618034c95ceace95262e440807ccafc0c847544b96600497be
7
+ data.tar.gz: b89dc6f25b53ef930ed66c752947a539157cd4cda959a8288366431cb2ea0987ac7d5af6e3b5ab0a5ee49e341046fc47877133ade9c1fa05a8ba0a833add5368
@@ -16,6 +16,10 @@ module Editmode
16
16
  # Todo Add Header Version
17
17
  end
18
18
 
19
+ def allowed_tag_attributes
20
+ [:style, :href, :title, :src, :alt, :width, :height]
21
+ end
22
+
19
23
  def api_root_url
20
24
  ENV["EDITMODE_OVERRIDE_API_URL"] || "https://api.editmode.com"
21
25
  end
@@ -110,7 +114,7 @@ module Editmode
110
114
  end
111
115
  end
112
116
 
113
- def render_chunk_content(chunk_identifier, chunk_content, chunk_type,options = {})
117
+ def render_chunk_content(chunk_identifier, chunk_content, chunk_type, options = {})
114
118
  begin
115
119
  css_class = options[:class]
116
120
  cache_id = options[:cache_identifier]
@@ -132,17 +136,17 @@ module Editmode
132
136
  case display_type
133
137
  when "span"
134
138
  if chunk_type == "rich_text"
135
- content = content_tag("em-span", :class => "editmode-richtext-editor #{css_class}", :data => chunk_data.merge!({:chunk_editable => true}) ) do
139
+ content = content_tag("em-span", :class => "editmode-richtext-editor #{css_class}", :data => chunk_data.merge!({:chunk_editable => true}), **options.slice(*allowed_tag_attributes) ) do
136
140
  chunk_content.html_safe
137
141
  end
138
142
  else
139
- content_tag("em-span", :class => css_class, :data => chunk_data.merge!({:chunk_editable => true}) ) do
143
+ content_tag("em-span", :class => css_class, :data => chunk_data.merge!({:chunk_editable => true}), **options.slice(*allowed_tag_attributes) ) do
140
144
  chunk_content.html_safe
141
145
  end
142
146
  end
143
147
  when "image"
144
148
  chunk_content = chunk_content.blank? || chunk_content == "/images/original/missing.png" ? 'https://www.editmode.com/upload.png' : chunk_content
145
- image_tag(chunk_content, :data => chunk_data, :class => css_class)
149
+ image_tag(chunk_content, :data => chunk_data, :class => css_class, **options.slice(*allowed_tag_attributes))
146
150
  end
147
151
  rescue => errors
148
152
  puts errors
@@ -1,3 +1,3 @@
1
1
  module Editmode
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: editmode
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Ennis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-23 00:00:00.000000000 Z
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler