Permalink
Browse files

Merge branch 'stable'

Conflicts:
	VERSION
	doc-src/SASS_CHANGELOG.md
  • Loading branch information...
2 parents 216bca5 + 5ce407b commit f2e8507be75e78692f2d8e64e81f3a7a62443fd5 @nex3 nex3 committed Mar 22, 2013
Showing with 25 additions and 11 deletions.
  1. +9 −4 doc-src/SASS_CHANGELOG.md
  2. +1 −1 lib/sass/script/string.rb
  3. +3 −5 lib/sass/scss/rx.rb
  4. +12 −1 test/sass/scss/css_test.rb
View
@@ -74,7 +74,12 @@ Thanks to Alexander Pavlov for implementing this.
* `Sass::Script::Number::PRECISION` has been removed.
-## 3.2.7 (Unreleased)
+## 3.2.8 (Unreleased)
+
+* Fix some edge cases where redundant selectors were emitted when using
+ `@extend`.
+
+## 3.2.7
* The \{Sass::Script::Functions#index `index`} and \{Sass::Script::Functions#zip
`zip`} functions now work like all other list functions and treat individual
@@ -86,8 +91,8 @@ Thanks to Alexander Pavlov for implementing this.
* Emit relative paths when using the `--line-comments` flag of the `sass`
executable.
-* Fix some edge cases where redundant selectors were emitted when using
- `@extend`.
+* Fix a case where very long numbers would cause the SCSS parser to
+ take exponential time.
## 3.2.6
@@ -310,7 +315,7 @@ that make use of `@media` and other directives dynamically.
{Sass.load_paths}. This allows plugins and libraries to easily register their
Sass files such that they're accessible to all {Sass::Engine} instances.
-* `Sass.load_paths` is initialized to the value of the `SASS_PATH`environment
+* `Sass.load_paths` is initialized to the value of the `SASS_PATH` environment
variable. This variable should contain a colon-separated list of load paths
(semicolon-separated on Windows).
@@ -33,7 +33,7 @@ def plus(other)
# @see Node#to_s
def to_s(opts = {})
if @type == :identifier
- return @value.tr("\n", " ")
+ return @value.gsub(/\s+/, " ")
end
return "\"#{value.gsub('"', "\\\"")}\"" if opts[:quote] == %q{"}
View
@@ -124,11 +124,9 @@ def self.quote(str, flags = 0)
STRING1_NOINTERP = /\"((?:[^\n\r\f\\"#]|#(?!\{)|\\#{NL}|#{ESCAPE})*)\"/
STRING2_NOINTERP = /\'((?:[^\n\r\f\\'#]|#(?!\{)|\\#{NL}|#{ESCAPE})*)\'/
STRING_NOINTERP = /#{STRING1_NOINTERP}|#{STRING2_NOINTERP}/
- # Can't use IDENT here, because it seems to take exponential time on 1.8.
- # We could use it for 1.9 only, but I don't want to introduce a cross-version
- # behavior difference.
- # In any case, almost all CSS idents will be matched by this.
- STATIC_VALUE = /(-?#{NMSTART}|#{STRING_NOINTERP}|#[a-f0-9]|[,%]|-?#{NUMBER}|\!important)+([;}])/i
+
+ STATIC_COMPONENT = /#{IDENT}|#{STRING_NOINTERP}|#{HEXCOLOR}|[+-]?#{NUMBER}|\!important/i
+ STATIC_VALUE = /#{STATIC_COMPONENT}(\s*[\s,\/]\s*#{STATIC_COMPONENT})*([;}])/i
STATIC_SELECTOR = /(#{NMCHAR}|[ \t]|[,>+*]|[:#.]#{NMSTART}){0,50}([{])/i
end
end
View
@@ -425,7 +425,7 @@ def test_unary_ops
assert_equal <<CSS, render(<<SCSS)
foo {
a: -0.5em;
- b: 0.5em;
+ b: +0.5em;
c: -foo(12px);
d: +foo(12px); }
CSS
@@ -1011,6 +1011,17 @@ def test_error_with_windows_newlines
## Regressions
+ def test_very_long_number_with_important_doesnt_take_forever
+ assert_equal(<<CSS, render(<<SCSS))
+.foo {
+ width: 97.916666666666666666666666666667% !important; }
+CSS
+.foo {
+ width: 97.916666666666666666666666666667% !important;
+}
+SCSS
+ end
+
def test_selector_without_closing_bracket
assert_not_parses('"]"', "foo[bar <err>{a: b}")
end

0 comments on commit f2e8507

Please sign in to comment.