liquid-tag-parser 1.7.0 → 1.8.0

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
  SHA1:
3
- metadata.gz: bd8c6f633da42e565f8c6e744f5de6385cb58ee5
4
- data.tar.gz: 43fefa58e961df937b95fe110b11c7a6315ed2d9
3
+ metadata.gz: c057e184a8a4d338d450a92300d8f8439394b713
4
+ data.tar.gz: ca40ca9c306136b8b60d2b06c666d7990b8b746e
5
5
  SHA512:
6
- metadata.gz: e6a50303cb1f2abf3ed5d807918b81682d264d91a87bf51d5c7ff3731131a7e559fb15530a49d884afd1cabb0f849ffa70560934972c80af01eb6840691fc5dc
7
- data.tar.gz: c98e7886202657c54d46c9af31b4aac1cb60ab778f94af1920384cea4802d860c931e1a9fc012992edde64949b1f117691bb0bed9a588dc1820912f674644639
6
+ metadata.gz: 4d7330b46478d605bde569c1690e955384738e4a24cb66fb1edd69502f5054468f94610dde91853706ea9cdcb8d7ecbd530d0779f18afe99e9bdf57ae95cb967
7
+ data.tar.gz: 23a809b5033f64da2ac0fa1d2b53b5eb2d1be27fcb4283bf89025c8e66ee7a205321b1ec5a3cc5b9e73f8f579faddbf85f7466c3d6fde6f337c31397664de7cc
@@ -118,7 +118,7 @@ module Liquid
118
118
  private
119
119
  def argv1(i:, k:, v:)
120
120
  if i.zero? && k.empty? && v !~ BOOL && v !~ @sep_regexp
121
- @args[:argv1] = convert(v)
121
+ @args[:argv1] = unescape(convert(v))
122
122
  end
123
123
  end
124
124
 
@@ -154,15 +154,21 @@ module Liquid
154
154
  out
155
155
  end
156
156
 
157
+ private
158
+ def unescape(val)
159
+ return unless val
160
+ val.gsub(@escaped_sep_regexp, @unescaped_sep).gsub(
161
+ SPECIAL_ESCAPED, "\\1")
162
+ end
163
+
157
164
  # --
158
165
  private
159
166
  def parse
160
167
  from_shellwords.each_with_index do |k, i|
161
168
  keys, _, val = k.rpartition(@sep_regexp)
162
- val.gsub!(@escaped_sep_regexp, @unescaped_sep)
163
- val.gsub!(SPECIAL_ESCAPED, "\\1")
164
-
165
169
  next if argv1(i: i, k: keys, v: val)
170
+
171
+ val = unescape(val)
166
172
  keys, val = flip_kv_bool(val) if val =~ BOOL && keys.empty?
167
173
  keys, val = val, nil if keys.empty?
168
174
  keys = keys.split(KEY).map(&:to_sym)
@@ -5,7 +5,7 @@
5
5
  module Liquid
6
6
  class Tag
7
7
  class Parser
8
- VERSION = "1.7.0"
8
+ VERSION = "1.8.0"
9
9
  end
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid-tag-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordon Bedwell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-05 00:00:00.000000000 Z
11
+ date: 2017-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec