lib/rouge/formatters/html_line_highlighter.rb in rouge-3.24.0 vs lib/rouge/formatters/html_line_highlighter.rb in rouge-3.25.0

- old
+ new

@@ -11,13 +11,11 @@ @highlight_line_class = opts.fetch(:highlight_line_class, 'hll') @highlight_lines = opts[:highlight_lines] || [] end def stream(tokens) - lineno = 0 - token_lines(tokens) do |tokens_in_line| - lineno += 1 - line = %(#{@delegate.format(tokens_in_line)}\n) + token_lines(tokens).with_index(1) do |line_tokens, lineno| + line = %(#{@delegate.format(line_tokens)}\n) line = %(<span class="#{@highlight_line_class}">#{line}</span>) if @highlight_lines.include? lineno yield line end end end