summaryrefslogtreecommitdiff
path: root/lib/coderay/encoder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/encoder.rb')
-rw-r--r--lib/coderay/encoder.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/coderay/encoder.rb b/lib/coderay/encoder.rb
index 8b6c22a..8f8375a 100644
--- a/lib/coderay/encoder.rb
+++ b/lib/coderay/encoder.rb
@@ -130,10 +130,12 @@ module CodeRay
# By default, it calls text_token or block_token, depending on
# whether +text+ is a String.
def token text, kind
- if text.is_a? String
+ if text.is_a? ::String
text_token text, kind
- else
+ elsif text.is_a? ::Symbol
block_token text, kind
+ else
+ raise 'Unknown token text type: %p' % text
end
end