sass 3.7.1 → 3.7.2

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
- SHA256:
3
- metadata.gz: a43b1c30d00eac06d7c69a8847bb865ed176e8110498b707291c47bcc55971c0
4
- data.tar.gz: 927180d64da236f16bc1a3aba9b49cd82e245eb90e0b040097924412bc9a8407
2
+ SHA1:
3
+ metadata.gz: 6d321485d2c75f84d8d1dca9e7f0688e89fea8b4
4
+ data.tar.gz: '00048a6f7bf6aebc4cfa315c5e310cd6dce1958e'
5
5
  SHA512:
6
- metadata.gz: da741c30bf52a8abccf6d1865065323b26e1c58f496ab90dba99a290f304e8f38ab3ce9e724862a59d347b525087a4c1a1b88a2602e8370115d8436f2198e937
7
- data.tar.gz: cbf371f77685d06b62979e722116b3eeb3c2a5c0cf8b5bd811167b1c5d42d9285081af9d1bb9b2ceb631951e18e6d87e0083eceac9146d365f2f2b418670b06f
6
+ metadata.gz: 8c7f5ac95eb72221900787e775cf5fe666f3dc3847cf8f995e0ee31baaec4792c8db82f680e2b8442e61b3962cb4384dc05d5a1b024c8f1dfebba76f2e736451
7
+ data.tar.gz: b11807d9fd6fc877e2a1649e55fd7ab84162704c949df3548c1471548da3a8170fc3192e08a5d1dfe534d66a03629518cc69e966a65031b28450c22b0f956a7b
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.7.1
1
+ 3.7.2
@@ -1 +1 @@
1
- 07 November 2018 19:38:22 UTC
1
+ 08 November 2018 22:42:57 UTC
@@ -47,7 +47,12 @@ module Sass
47
47
  def keyframes_ruleset
48
48
  start_pos = source_position
49
49
  return unless (selector = keyframes_selector)
50
- block(node(Sass::Tree::KeyframeRuleNode.new(selector.strip), start_pos), :ruleset)
50
+ block(
51
+ node(
52
+ Sass::Tree::KeyframeRuleNode.new(
53
+ Sass::Util.strip_except_escapes(selector)),
54
+ start_pos),
55
+ :ruleset)
51
56
  end
52
57
 
53
58
  @sass_script_parser = Sass::Script::CssParser
@@ -992,8 +992,9 @@ module Sass
992
992
  # This results in a dramatic speed increase.
993
993
  if (val = tok(STATIC_VALUE))
994
994
  # If val ends with escaped whitespace, leave it be.
995
- val = val.lstrip.sub(/(?<!\\)\s*$/, '\1')
996
- str = Sass::Script::Tree::Literal.new(Sass::Script::Value::String.new(val.strip))
995
+ str = Sass::Script::Tree::Literal.new(
996
+ Sass::Script::Value::String.new(
997
+ Sass::Util.strip_except_escapes(val)))
997
998
  str.line = start_pos.line
998
999
  str.source_range = range(start_pos)
999
1000
  return str
@@ -134,7 +134,7 @@ module Sass
134
134
  res = (syntactic_type == :class ? ":" : "::") + @name
135
135
  if @arg || @selector
136
136
  res << "("
137
- res << @arg.strip if @arg
137
+ res << Sass::Util.strip_except_escapes(@arg) if @arg
138
138
  res << " " if @arg && @selector
139
139
  res << @selector.to_s(opts) if @selector
140
140
  res << ")"
@@ -140,7 +140,8 @@ module Sass::Tree
140
140
  # When we get it, we'll set it on the parsed rules if possible.
141
141
  parser = nil
142
142
  warnings = Sass.logger.capture do
143
- parser = Sass::SCSS::StaticParser.new(@rule.join.strip, nil, nil, 1)
143
+ parser = Sass::SCSS::StaticParser.new(
144
+ Sass::Util.strip_except_escapes(@rule.join), nil, nil, 1)
144
145
  @parsed_rules = parser.parse_selector rescue nil
145
146
  end
146
147
 
@@ -553,7 +553,7 @@ WARNING
553
553
  end
554
554
 
555
555
  def run_interp(text)
556
- run_interp_no_strip(text).strip
556
+ Sass::Util.strip_except_escapes(run_interp_no_strip(text))
557
557
  end
558
558
 
559
559
  def handle_import_loop!(node)
@@ -298,7 +298,7 @@ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
298
298
  rule_part.gsub!(/nth([^( ]*)\(([^)]*)\)/m) do |match|
299
299
  match.tr(" \t\n", "")
300
300
  end
301
- rule_part.strip!
301
+ rule_part = Sass::Util.strip_except_escapes(rule_part)
302
302
  end
303
303
  rule_part
304
304
  end.compact.join(rule_separator)
@@ -246,15 +246,15 @@ module Sass
246
246
  res
247
247
  end
248
248
 
249
- # Destructively strips whitespace from the beginning and end
250
- # of the first and last elements, respectively,
251
- # in the array (if those elements are strings).
249
+ # Destructively strips whitespace from the beginning and end of the first
250
+ # and last elements, respectively, in the array (if those elements are
251
+ # strings). Preserves CSS escapes at the end of the array.
252
252
  #
253
253
  # @param arr [Array]
254
254
  # @return [Array] `arr`
255
255
  def strip_string_array(arr)
256
256
  arr.first.lstrip! if arr.first.is_a?(String)
257
- arr.last.rstrip! if arr.last.is_a?(String)
257
+ arr[-1] = Sass::Util.rstrip_except_escapes(arr[-1]) if arr.last.is_a?(String)
258
258
  arr
259
259
  end
260
260
 
@@ -289,6 +289,24 @@ module Sass
289
289
  end
290
290
  end
291
291
 
292
+ # Like [String#strip], but preserves escaped whitespace at the end of the
293
+ # string.
294
+ #
295
+ # @param string [String]
296
+ # @return [String]
297
+ def strip_except_escapes(string)
298
+ rstrip_except_escapes(string.lstrip)
299
+ end
300
+
301
+ # Like [String#rstrip], but preserves escaped whitespace at the end of the
302
+ # string.
303
+ #
304
+ # @param string [String]
305
+ # @return [String]
306
+ def rstrip_except_escapes(string)
307
+ string.sub(/(?<!\\)\s+$/, '')
308
+ end
309
+
292
310
  # Return an array of all possible paths through the given arrays.
293
311
  #
294
312
  # @param arrs [Array<Array>]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-11-07 00:00:00.000000000 Z
13
+ date: 2018-11-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sass-listen
@@ -276,7 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
276
  version: '0'
277
277
  requirements: []
278
278
  rubyforge_project: sass
279
- rubygems_version: 2.7.7
279
+ rubygems_version: 2.6.14
280
280
  signing_key:
281
281
  specification_version: 4
282
282
  summary: A powerful but elegant CSS compiler that makes CSS fun again.