editmode 1.2.3 → 1.2.4

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: 78dda874aecacc9edfdf0e96598019e7dad8cc44693336d94511083238b55a91
4
- data.tar.gz: d111ab02c60c737e5711139473e7be988f02ffdb3a8ed01a7876174348bf5d83
3
+ metadata.gz: bd467da504ef11a5ba029cc7dcf3b4957dbbc758fa37fe8cf38f2aed358fb17b
4
+ data.tar.gz: 577f1989ff49f7c624fd2d1864cc78c6bd0f3249e7c67951bf6b94e375794744
5
5
  SHA512:
6
- metadata.gz: e896421ca91061b25d28bc0ea217a2891df5f06d109b00301364ad67c3813caf2de47219f0be1b13ac335b6a8b76bcdaa5dc10b5ad4a9308722e90939613cbaf
7
- data.tar.gz: 9ad90b4008998f64e52cfe34c73c74db62633b468764f0939df16ffb4fbeb1a9acbbdee0acfe053e793ff66b316f9c8ecde7bb64544b81013828e61383995f69
6
+ metadata.gz: 5466ebc92b03dde2acc135dd0e90ff54c2b18242a0eb5011889ff429fd5c168f9ec09b7181be3df8d8a864f78911a49b620b0ed239a3aec9330e4d3fb9b3a3f7
7
+ data.tar.gz: bd302d21b044b4927e787f5aaacc530bae2a811f5e72138519b6b2b5cc594dc6322ec9fa026a1fa256d5d65a26ee79877d0256e547a11ad6589197482d0e5fb1
@@ -16,6 +16,7 @@ module Editmode
16
16
  @project_id = Editmode.project_id
17
17
  @variable_values = options[:variables].presence || {}
18
18
  @raw = options[:raw].present?
19
+ @skip_sanitize = options[:dangerously_skip_sanitization]
19
20
 
20
21
  @url = "#{api_root_url}/chunks/#{identifier}"
21
22
  @cache_identifier = set_cache_identifier(identifier)
@@ -35,7 +36,7 @@ module Editmode
35
36
  field_chunk = field_chunk(field)
36
37
  if field_chunk.present?
37
38
  result = field_chunk['content']
38
- result = variable_parse!(result, variable_fallbacks, variable_values, @raw)
39
+ result = variable_parse!(result, variable_fallbacks, variable_values, @raw, @skip_sanitize)
39
40
  else
40
41
  raise no_response_received(field)
41
42
  end
@@ -57,7 +58,7 @@ module Editmode
57
58
  def content
58
59
  raise "undefined method 'content' for chunk_type: collection_item \nDid you mean? field" if chunk_type == 'collection_item'
59
60
 
60
- result = variable_parse!(@content, variable_fallbacks, variable_values, @raw)
61
+ result = variable_parse!(@content, variable_fallbacks, variable_values, @raw, @skip_sanitize)
61
62
  result.try(:html_safe)
62
63
  end
63
64
 
@@ -79,8 +80,8 @@ module Editmode
79
80
  return false
80
81
  end
81
82
 
82
- def variable_parse!(content, variables = {}, values = {}, raw = true)
83
- content = ActionController::Base.helpers.sanitize(content)
83
+ def variable_parse!(content, variables = {}, values = {}, raw = true, skip_sanitize=false)
84
+ content = ActionController::Base.helpers.sanitize(content) unless skip_sanitize
84
85
  tokens = content.scan(/\{{(.*?)\}}/)
85
86
  if tokens.any?
86
87
  tokens.flatten!
@@ -1,3 +1,3 @@
1
1
  module Editmode
2
- VERSION = "1.2.3"
3
- end
2
+ VERSION = "1.2.4"
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.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Ennis
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-23 00:00:00.000000000 Z
11
+ date: 2020-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,7 +94,7 @@ homepage: https://github.com/tonyennis145/editmode-rails
94
94
  licenses:
95
95
  - MIT
96
96
  metadata: {}
97
- post_install_message:
97
+ post_install_message:
98
98
  rdoc_options: []
99
99
  require_paths:
100
100
  - lib
@@ -109,8 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubygems_version: 3.0.8
113
- signing_key:
112
+ rubygems_version: 3.0.3
113
+ signing_key:
114
114
  specification_version: 4
115
115
  summary: Editmode allows you to turn plain text in your rails app into easily inline-editable
116
116
  bits of content that can be managed by anyone with no technical knowledge