mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Don't push all text in :ruby filters onto one line.
This commit is contained in:
parent
b54ff8dbe6
commit
9016da55f5
2 changed files with 4 additions and 3 deletions
|
@ -187,13 +187,13 @@ END
|
||||||
def compile(precompiler, text)
|
def compile(precompiler, text)
|
||||||
return if precompiler.options[:suppress_eval]
|
return if precompiler.options[:suppress_eval]
|
||||||
precompiler.instance_eval do
|
precompiler.instance_eval do
|
||||||
push_silent <<-END.gsub("\n", ';')
|
push_silent <<-FIRST.gsub("\n", ';') + text + <<-LAST.gsub("\n", ';')
|
||||||
_haml_old_stdout = $stdout
|
_haml_old_stdout = $stdout
|
||||||
$stdout = StringIO.new(_hamlout.buffer, 'a')
|
$stdout = StringIO.new(_hamlout.buffer, 'a')
|
||||||
#{text}
|
FIRST
|
||||||
_haml_old_stdout, $stdout = $stdout, _haml_old_stdout
|
_haml_old_stdout, $stdout = $stdout, _haml_old_stdout
|
||||||
_haml_old_stdout.close
|
_haml_old_stdout.close
|
||||||
END
|
LAST
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -56,6 +56,7 @@ END
|
||||||
A tab character was used for indentation. Haml must be indented using two spaces.
|
A tab character was used for indentation. Haml must be indented using two spaces.
|
||||||
Are you sure you have soft tabs enabled in your editor?
|
Are you sure you have soft tabs enabled in your editor?
|
||||||
END
|
END
|
||||||
|
"foo\n:ruby\n 1\n 2\n 3\n- raise 'foo'" => ["foo", 6],
|
||||||
}
|
}
|
||||||
|
|
||||||
User = Struct.new('User', :id)
|
User = Struct.new('User', :id)
|
||||||
|
|
Loading…
Add table
Reference in a new issue