From 0e8008ad88b4f56e35d71c3029d02ffb4e21120f Mon Sep 17 00:00:00 2001 From: Etienne Massip Date: Thu, 26 Jan 2012 21:14:59 +0100 Subject: Extracted code making HTML lines independent from numbering code to a specific option in encoder. --- lib/coderay/encoders/html/numbering.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'lib/coderay/encoders/html') diff --git a/lib/coderay/encoders/html/numbering.rb b/lib/coderay/encoders/html/numbering.rb index 15ce11b..904a64f 100644 --- a/lib/coderay/encoders/html/numbering.rb +++ b/lib/coderay/encoders/html/numbering.rb @@ -68,23 +68,11 @@ module Encoders when :inline max_width = (start + line_count).to_s.size line_number = start - nesting = [] output.gsub!(/^.*$\n?/) do |line| - line.chomp! - open = nesting.join - line.scan(%r!<(/)?span[^>]*>?!) do |close,| - if close - nesting.pop - else - nesting << $& - end - end - close = '' * nesting.size - line_number_text = bolding.call line_number indent = ' ' * (max_width - line_number.to_s.size) # TODO: Optimize (10^x) line_number += 1 - "#{indent}#{line_number_text}#{open}#{line}#{close}\n" + "#{indent}#{line_number_text}#{line}" end when :table @@ -112,4 +100,4 @@ module Encoders end end -end +end \ No newline at end of file -- cgit v1.2.1