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:
Nathan Weizenbaum 2008-04-29 16:38:43 -07:00
parent 562a89e200
commit 5a6d99b830
1 changed files with 1 additions and 1 deletions

View File

@ -266,7 +266,7 @@ module Sass
rules = OrderedHash.new
root.children.select { |c| Tree::RuleNode === c }.each do |child|
root.children.delete child
first, rest = child.rule.scan(/^(&?.[^.#: \[]*)([.#: \[].*)?$/).first
first, rest = child.rule.scan(/^(&?(?: .|[^ ])[^.#: \[]*)([.#: \[].*)?$/).first
rules[first] ||= Tree::RuleNode.new(first, nil)
if rest
child.rule = "&" + rest