diff options
author | murphy <murphy@rubychan.de> | 2007-04-24 12:26:18 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2007-04-24 12:26:18 +0000 |
commit | 3ecc8116cc06289724f9a2ccf734e99d843abc79 (patch) | |
tree | f4f20fe32327d5127a2778b5cd19baea644c3fd8 /lib/coderay/tokens.rb | |
parent | 47ba0455640b4a6a0ae90961c176c9ea42afa2ea (diff) | |
download | coderay-3ecc8116cc06289724f9a2ccf734e99d843abc79.tar.gz |
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.
Diffstat (limited to 'lib/coderay/tokens.rb')
-rw-r--r-- | lib/coderay/tokens.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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. |