summaryrefslogtreecommitdiff
path: root/lib/coderay/tokens.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/tokens.rb')
-rw-r--r--lib/coderay/tokens.rb6
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.