From b9af766886ef010d4f33abbe8ab314bb85f8c3ba Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 28 Jan 2010 09:18:32 -0800 Subject: [PATCH] Handle pass-thru @if nodes. --- doc-src/lib/stylesheets/sass_extensions.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/doc-src/lib/stylesheets/sass_extensions.rb b/doc-src/lib/stylesheets/sass_extensions.rb index c3980b42..bdde44c8 100644 --- a/doc-src/lib/stylesheets/sass_extensions.rb +++ b/doc-src/lib/stylesheets/sass_extensions.rb @@ -31,15 +31,19 @@ module Sass end class IfNode < Node def to_sass - sass_str = %Q{@if #{@expr.inspect unless @expr.nil?} - - #{children_to_sass} - -}.gsub(/^\s+-/,'') - if @else - sass_str << %Q{@else - - #{tab @else.to_sass} + if @expr.nil? + children_to_sass + else + sass_str = %Q{@if #{@expr.to_sass} + - #{children_to_sass} -}.gsub(/^\s+-/,'') + if @else + sass_str << %Q{@else + - #{tab @else.to_sass} + -}.gsub(/^\s+-/,'') + end + sass_str end - sass_str end end class DebugNode < Node