summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/encoders')
-rw-r--r--lib/coderay/encoders/html.rb8
-rw-r--r--lib/coderay/encoders/html/output.rb6
-rw-r--r--lib/coderay/encoders/terminal.rb4
3 files changed, 6 insertions, 12 deletions
diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb
index 4c5695d..d6dfb9e 100644
--- a/lib/coderay/encoders/html.rb
+++ b/lib/coderay/encoders/html.rb
@@ -136,13 +136,7 @@ module Encoders
HTML_ESCAPE_PATTERN = /[\t"&><\0-\x8\xB-\x1f]/
TOKEN_KIND_TO_INFO = Hash.new do |h, kind|
- h[kind] =
- case kind
- when :pre_constant # FIXME: rename to :predefined_constant
- 'Predefined constant'
- else
- kind.to_s.gsub(/_/, ' ').gsub(/\b\w/) { $&.capitalize }
- end
+ h[kind] = kind.to_s.gsub(/_/, ' ').gsub(/\b\w/) { $&.capitalize }
end
TRANSPARENT_TOKEN_KINDS = Set[
diff --git a/lib/coderay/encoders/html/output.rb b/lib/coderay/encoders/html/output.rb
index 40e3b04..5aa80a7 100644
--- a/lib/coderay/encoders/html/output.rb
+++ b/lib/coderay/encoders/html/output.rb
@@ -3,14 +3,14 @@ module Encoders
class HTML
- # This module is included in the output String from thew HTML Encoder.
+ # This module is included in the output String of the HTML Encoder.
#
# It provides methods like wrap, div, page etc.
#
# Remember to use #clone instead of #dup to keep the modules the object was
# extended with.
#
- # TODO: more doc.
+ # TODO: Rewrite this without monkey patching.
module Output
attr_accessor :css
@@ -25,7 +25,7 @@ module Encoders
def make_stylesheet css, in_tag = false # :nodoc:
sheet = css.stylesheet
- sheet = <<-CSS if in_tag
+ sheet = <<-'CSS' if in_tag
<style type="text/css">
#{sheet}
</style>
diff --git a/lib/coderay/encoders/terminal.rb b/lib/coderay/encoders/terminal.rb
index 4d64aba..860ea9c 100644
--- a/lib/coderay/encoders/terminal.rb
+++ b/lib/coderay/encoders/terminal.rb
@@ -53,8 +53,8 @@ module CodeRay
:local_variable => '33',
:oct => '1;35',
:operator_name => '1;29',
- :pre_constant => '1;36',
- :pre_type => '1;30',
+ :predefined_constant => '1;36',
+ :predefined_type => '1;30',
:predefined => ['4', '1;34'],
:preprocessor => '36',
:pseudo_class => '34',