From 3ecc8116cc06289724f9a2ccf734e99d843abc79 Mon Sep 17 00:00:00 2001 From: murphy Date: Tue, 24 Apr 2007 12:26:18 +0000 Subject: Benchmark, comparison: replaced SilverCity with pygments A bit of code and documentation cleanup HTML encoder: fixed css class output for NO_HIGHLIGHT tokens when :info is set. Fixed Text encoder. --- lib/coderay/tokens.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/coderay/tokens.rb') diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb index d05177a..26c923f 100644 --- a/lib/coderay/tokens.rb +++ b/lib/coderay/tokens.rb @@ -267,7 +267,11 @@ module CodeRay # Should be equal to the input size before # scanning. def text_size - inject(0) { |size, (t, k)| t.is_a?(::String) ? size : size + t.size } + size = 0 + each_text_token do |t, k| + size + t.size + end + size end # The total size of the tokens. -- cgit v1.2.1