1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

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

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