diff options
Diffstat (limited to 'lib/coderay/encoders/html')
-rw-r--r-- | lib/coderay/encoders/html/numbering.rb | 16 |
1 files changed, 2 insertions, 14 deletions
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 = '</span>' * nesting.size - line_number_text = bolding.call line_number indent = ' ' * (max_width - line_number.to_s.size) # TODO: Optimize (10^x) line_number += 1 - "<span class=\"line-numbers\">#{indent}#{line_number_text}</span>#{open}#{line}#{close}\n" + "<span class=\"line-numbers\">#{indent}#{line_number_text}</span>#{line}" end when :table @@ -112,4 +100,4 @@ module Encoders end end -end +end
\ No newline at end of file |