Skip to content

Commit

Permalink
Fix a bug where multiple spaces in a string literal would sometimes b…
Browse files Browse the repository at this point in the history
…e folded together.

Closes #686
  • Loading branch information
nex3 committed Apr 17, 2013
1 parent 5f4c6c9 commit b2864aa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc-src/SASS_CHANGELOG.md
Expand Up @@ -13,6 +13,9 @@
* Fix a bug in `sass-convert` where lists being passed as arguments to functions
or mixins would lose their surrounding parentheses.

* Fix a bug where multiple spaces in a string literal would sometimes be folded
together.

## 3.2.7

* The \{Sass::Script::Functions#index `index`} and \{Sass::Script::Functions#zip
Expand Down
2 changes: 1 addition & 1 deletion lib/sass/script/string.rb
Expand Up @@ -33,7 +33,7 @@ def plus(other)
# @see Node#to_s
def to_s(opts = {})
if @type == :identifier
return @value.gsub(/\s+/, " ")
return @value.gsub(/\n\s*/, " ")
end

return "\"#{value.gsub('"', "\\\"")}\"" if opts[:quote] == %q{"}
Expand Down
11 changes: 11 additions & 0 deletions test/sass/scss/css_test.rb
Expand Up @@ -1011,6 +1011,17 @@ def test_error_with_windows_newlines

## Regressions

def test_double_space_string
assert_equal(<<CSS, render(<<SCSS))
.a {
content: " a"; }
CSS
.a {
content: " a";
}
SCSS
end

def test_very_long_number_with_important_doesnt_take_forever
assert_equal(<<CSS, render(<<SCSS))
.foo {
Expand Down

0 comments on commit b2864aa

Please sign in to comment.