editmode 1.3.0 → 1.3.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 392f282609e410c8656791b6120245b8b4c790ed8ba102d6dfe1c5d2062acd6f
|
4
|
+
data.tar.gz: 94246ddabf9aadcdf65ceab231e83a6704a7d89f39ce5039685b7f44ea4e18c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/editmode/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2021-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|