From c410e9dc6511962422e2b3615c8d4a7a5825d894 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Fri, 29 Apr 2011 12:24:40 -0700 Subject: [PATCH] output css errors from sass. closes #43 --- lib/middleman/renderers/sass.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/middleman/renderers/sass.rb b/lib/middleman/renderers/sass.rb index 5bb18606..75e40956 100644 --- a/lib/middleman/renderers/sass.rb +++ b/lib/middleman/renderers/sass.rb @@ -47,6 +47,14 @@ class Tilt::SassPlusCSSFilenameTemplate < Tilt::SassTemplate css_filename = File.join(location_of_sass_file, Middleman::Server.css_dir, parts.join(".")) super.merge(::Compass.configuration.to_sass_engine_options).merge(:css_filename => css_filename) end + + def evaluate(scope, locals, &block) + begin + super + rescue Sass::SyntaxError => e + Sass::SyntaxError.exception_to_css(e, :full_exception => true) + end + end end Tilt.register 'sass', Tilt::SassPlusCSSFilenameTemplate