diff options
Diffstat (limited to 'lib/rouge')
-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 |