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

Render ; instead of \n when multiple blocks end

That way the source line number matches the haml input.
This commit is contained in:
Grant Hutchins & Sabrina Staedt 2012-12-17 21:19:13 +00:00 committed by Matt Wildig
parent f32b60909c
commit 9c0ed6d01f

View file

@ -314,8 +314,9 @@ END
def push_silent(text, can_suppress = false)
flush_merged_text
return if can_suppress && @options.suppress_eval?
@precompiled << "#{resolve_newlines}#{text}\n"
@output_line += text.count("\n") + 1
newline = (text == "end") ? ";" : "\n"
@precompiled << "#{resolve_newlines}#{text}#{newline}"
@output_line += (text + newline).count("\n")
end
# Adds `text` to `@buffer` with appropriate tabulation