diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-06-21 21:23:10 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-07-14 20:08:15 +0300 |
commit | d625f652916c7039797190351d1dc04c6152ce78 (patch) | |
tree | bf068995238b443fa824c5a203df369f24bb2e84 /lib/rouge/formatters | |
parent | 001b1ff312df04e014a82fdb831a77cfaf66fd62 (diff) |
eliminate the final newline in <pre> blocks
Diffstat (limited to 'lib/rouge/formatters')
-rw-r--r-- | lib/rouge/formatters/html_gitlab.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rouge/formatters/html_gitlab.rb b/lib/rouge/formatters/html_gitlab.rb index 31533fc3b8c..b76cf14a536 100644 --- a/lib/rouge/formatters/html_gitlab.rb +++ b/lib/rouge/formatters/html_gitlab.rb @@ -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 |