mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] [Convert] Fix a rare bug with multiline selectors getting cut off.
This commit is contained in:
parent
014bc114cd
commit
ab289bd9e9
3 changed files with 19 additions and 1 deletions
|
@ -50,6 +50,9 @@ this won't cause any backwards-incompatibilities.
|
|||
* Perform all conversions to rules within directive blocks
|
||||
when converting CSS.
|
||||
|
||||
* Prevent multiline CSS selectors from getting cut off
|
||||
in certain rare cases.
|
||||
|
||||
### `@import` in Sass
|
||||
|
||||
The Sass `@import` statement now allows non-CSS files to be specified with quotes,
|
||||
|
|
|
@ -134,7 +134,7 @@ module Sass
|
|||
next child
|
||||
end
|
||||
|
||||
first, rest = child.rule.first.scan(/^(&?(?: .|[^ ])[^.#: \[]*)([.#: \[].*)?$/).first
|
||||
first, rest = child.rule.first.scan(/\A(&?(?: .|[^ ])[^.#: \[]*)([.#: \[].*)?\Z/m).first
|
||||
|
||||
if current_rule.nil? || current_rule.rule.first != first
|
||||
current_rule = Tree::RuleNode.new([first])
|
||||
|
|
|
@ -253,6 +253,21 @@ SASS
|
|||
CSS
|
||||
end
|
||||
|
||||
def test_multiline_selector_within_media_and_with_child_selector
|
||||
assert_equal(<<SASS, css2sass(<<CSS))
|
||||
@media all
|
||||
foo bar, baz
|
||||
padding-left: 0
|
||||
padding-right: 0
|
||||
SASS
|
||||
@media all {
|
||||
foo bar,
|
||||
baz {
|
||||
padding-left: 0;
|
||||
padding-right: 0; } }
|
||||
CSS
|
||||
end
|
||||
|
||||
# Error reporting
|
||||
|
||||
def test_error_reporting
|
||||
|
|
Loading…
Reference in a new issue