Commit d625f652 authored by http://jneen.net/'s avatar http://jneen.net/

eliminate the final newline in <pre> blocks

parent 001b1ff3
...@@ -12,10 +12,14 @@ module Rouge ...@@ -12,10 +12,14 @@ module Rouge
end end
def stream(tokens, &b) def stream(tokens, &b)
is_first = true
token_lines(tokens) do |line| token_lines(tokens) do |line|
yield "\n" unless is_first
is_first = false
yield %<<span id="LC#{@line_number}" class="line">> yield %<<span id="LC#{@line_number}" class="line">>
line.each { |token, value| yield span(token, value) } line.each { |token, value| yield span(token, value) }
yield %<</span>\n> yield %<</span>>
@line_number += 1 @line_number += 1
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment