eliminate the final newline in <pre> blocks

This commit is contained in:
http://jneen.net/ 2016-06-21 11:23:10 -07:00
parent 001b1ff312
commit d625f65291

View file

@ -12,10 +12,14 @@ module Rouge
end
def stream(tokens, &b)
is_first = true
token_lines(tokens) do |line|
yield "\n" unless is_first
is_first = false
yield %<<span id="LC#{@line_number}" class="line">>
line.each { |token, value| yield span(token, value) }
yield %<</span>\n>
yield %<</span>>
@line_number += 1
end