summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2006-03-23 00:05:58 +0000
committermurphy <murphy@rubychan.de>2006-03-23 00:05:58 +0000
commit7863986fad84f56ba537ce3714d614c33391fd85 (patch)
treed1fc02f8da8dcb55dd1018203adf18d9b0d31ee7 /lib/coderay/encoders
parent2ee9927772880382e8ab3819805e6e3c62723395 (diff)
downloadcoderay-7863986fad84f56ba537ce3714d614c33391fd85.tar.gz
HTML Encoder: inline numerization corrected.
New demo: demo/demo_html_list.rb. Some demos adjusted. C Scanner: error messages fixed. Rakefile: test_demos now in debug mode. test/suite.rb is using reusable Scanners now.
Diffstat (limited to 'lib/coderay/encoders')
-rw-r--r--lib/coderay/encoders/html/numerization.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/coderay/encoders/html/numerization.rb b/lib/coderay/encoders/html/numerization.rb
index c5d96f3..19c760e 100644
--- a/lib/coderay/encoders/html/numerization.rb
+++ b/lib/coderay/encoders/html/numerization.rb
@@ -57,8 +57,10 @@ module Encoders
line = start
gsub!(/^/) do
line_number = bolding.call line
+ indent = ' ' * (max_width - line.to_s.size)
+ res = "<span class=\"no\">#{indent}#{line_number}</span> "
line += 1
- "<span class=\"no\">#{ line_number.rjust(max_width) }</span> "
+ res
end
when :table