diff --git a/lib/haml/precompiler.rb b/lib/haml/precompiler.rb index ef4ec2c1..3c9fd16b 100644 --- a/lib/haml/precompiler.rb +++ b/lib/haml/precompiler.rb @@ -643,7 +643,7 @@ END # Counts the tabulation of a line. def count_soft_tabs(line) - spaces = line.index(/[^ ]/) + spaces = line.index(/([^ ]|$)/) if line[spaces] == ?\t return nil if line.strip.empty? raise SyntaxError.new("Illegal Indentation: Only two space characters are allowed as tabulation.")