mirror of
https://github.com/zhigang1992/sass.git
synced 2026-04-29 09:45:35 +08:00
@@ -187,8 +187,9 @@ adding multiple suffixes to the same parent selector. For example:
|
||||
!global` will assign to `$var` globally. This behavior can be detected using
|
||||
`feature-exists(global-variable-shadowing)`.
|
||||
|
||||
* SassScript strings in SCSS may no longer include unescaped newlines. As doing
|
||||
so produced invalid CSS, there will be no deprecation period for this change.
|
||||
* Unescaped newlines in SassScript strings in SCSS are deprecated, since they're
|
||||
invalid according to the CSS string grammar. To include a newline in a string,
|
||||
use "\a" or "\a " as in CSS.
|
||||
|
||||
## 3.3.9 (27 June 2014)
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ module Sass
|
||||
private
|
||||
|
||||
def string_re(open, close)
|
||||
/#{open}((?:\\.|\#(?!\{)|[^#{close}\n\\#])*)(#{close}|#\{)/m
|
||||
/#{open}((?:\\.|\#(?!\{)|[^#{close}\\#])*)(#{close}|#\{)/m
|
||||
end
|
||||
end
|
||||
|
||||
@@ -275,7 +275,16 @@ module Sass
|
||||
end
|
||||
|
||||
def string(re, open)
|
||||
line, offset = @line, @offset
|
||||
return unless scan(STRING_REGULAR_EXPRESSIONS[re][open])
|
||||
if @scanner[0] =~ /([^\\]|^)\n/
|
||||
Sass::Util.sass_warn <<MESSAGE
|
||||
DEPRECATION WARNING on line #{line}, column #{offset}#{" of #{@filename}" if @filename}:
|
||||
Unescaped multiline strings are deprecated and will be removed in a future version of Sass.
|
||||
To include a newline in a string, use "\\a" or "\\a " as in CSS.
|
||||
MESSAGE
|
||||
end
|
||||
|
||||
if @scanner[2] == '#{' # '
|
||||
@scanner.pos -= 2 # Don't actually consume the #{
|
||||
@offset -= 2
|
||||
|
||||
@@ -3436,7 +3436,24 @@ bang";
|
||||
bar: $var;
|
||||
}
|
||||
SCSS
|
||||
end
|
||||
end
|
||||
|
||||
def test_raw_newline_warning
|
||||
assert_warning(<<MESSAGE.rstrip) {assert_equal(<<CSS, render(<<SCSS))}
|
||||
DEPRECATION WARNING on line 2, column 9:
|
||||
Unescaped multiline strings are deprecated and will be removed in a future version of Sass.
|
||||
To include a newline in a string, use "\\a" or "\\a " as in CSS.
|
||||
MESSAGE
|
||||
.foo {
|
||||
bar: "baz\\a bang"; }
|
||||
CSS
|
||||
.foo {
|
||||
$var: "baz
|
||||
bang";
|
||||
bar: $var;
|
||||
}
|
||||
SCSS
|
||||
end
|
||||
|
||||
# Regression
|
||||
|
||||
|
||||
Reference in New Issue
Block a user