summaryrefslogtreecommitdiff
path: root/lib/coderay/encoder.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2007-04-24 12:26:18 +0000
committermurphy <murphy@rubychan.de>2007-04-24 12:26:18 +0000
commit3ecc8116cc06289724f9a2ccf734e99d843abc79 (patch)
treef4f20fe32327d5127a2778b5cd19baea644c3fd8 /lib/coderay/encoder.rb
parent47ba0455640b4a6a0ae90961c176c9ea42afa2ea (diff)
downloadcoderay-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/encoder.rb')
-rw-r--r--lib/coderay/encoder.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/coderay/encoder.rb b/lib/coderay/encoder.rb
index ce65832..8e67172 100644
--- a/lib/coderay/encoder.rb
+++ b/lib/coderay/encoder.rb
@@ -42,7 +42,7 @@ module CodeRay
# downcase class name instead.
def const_missing sym
if sym == :FILE_EXTENSION
- sym.to_s.downcase
+ plugin_id
else
super
end
@@ -132,13 +132,14 @@ module CodeRay
# By default, it calls text_token or block_token, depending on
# whether +text+ is a String.
def token text, kind
- out = if text.instance_of? ::String # Ruby 1.9: :open.is_a? String
- text_token text, kind
- elsif text.is_a? ::Symbol
- block_token text, kind
- else
- raise 'Unknown token text type: %p' % text
- end
+ out =
+ if text.is_a? ::String # Ruby 1.9: :open.is_a? String
+ text_token text, kind
+ elsif text.is_a? ::Symbol
+ block_token text, kind
+ else
+ raise 'Unknown token text type: %p' % text
+ end
@out << out if @out
end