css2sass doesn't get confused by CSS rules starting with . or #
This caused it to trip up on stuff like .a.b .c { a: b } .a.b .d { a: b }
This commit is contained in:
parent
562a89e200
commit
5a6d99b830
|
@ -266,7 +266,7 @@ module Sass
|
||||||
rules = OrderedHash.new
|
rules = OrderedHash.new
|
||||||
root.children.select { |c| Tree::RuleNode === c }.each do |child|
|
root.children.select { |c| Tree::RuleNode === c }.each do |child|
|
||||||
root.children.delete child
|
root.children.delete child
|
||||||
first, rest = child.rule.scan(/^(&?.[^.#: \[]*)([.#: \[].*)?$/).first
|
first, rest = child.rule.scan(/^(&?(?: .|[^ ])[^.#: \[]*)([.#: \[].*)?$/).first
|
||||||
rules[first] ||= Tree::RuleNode.new(first, nil)
|
rules[first] ||= Tree::RuleNode.new(first, nil)
|
||||||
if rest
|
if rest
|
||||||
child.rule = "&" + rest
|
child.rule = "&" + rest
|
||||||
|
|
Loading…
Reference in New Issue