summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay')
-rw-r--r--lib/coderay/encoders/html/numerization.rb4
-rw-r--r--lib/coderay/encoders/html/output.rb2
-rw-r--r--lib/coderay/scanners/ruby.rb8
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/coderay/encoders/html/numerization.rb b/lib/coderay/encoders/html/numerization.rb
index f51b5d3..edce9eb 100644
--- a/lib/coderay/encoders/html/numerization.rb
+++ b/lib/coderay/encoders/html/numerization.rb
@@ -12,9 +12,9 @@ module CodeRay
NUMERIZABLE_WRAPPINGS = {
:table => [:div, :page],
:inline => :all,
- :list => [:div, :page],
- nil => :all
+ :list => [:div, :page]
}
+ NUMERIZABLE_WRAPPINGS.default = :all
def numerize! mode = :table, options = {}
return self unless mode
diff --git a/lib/coderay/encoders/html/output.rb b/lib/coderay/encoders/html/output.rb
index 36018a7..8096dc8 100644
--- a/lib/coderay/encoders/html/output.rb
+++ b/lib/coderay/encoders/html/output.rb
@@ -25,7 +25,7 @@ module CodeRay
#
# a = Output.new '<span class="co">Code</span>'
# a.wrap! :page
- def new string, css, element = nil
+ def new string, css = CSS.new, element = nil
output = string.clone.extend self
output.wrapped_in = element
output.css = css
diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb
index 6b4c8ea..8952422 100644
--- a/lib/coderay/scanners/ruby.rb
+++ b/lib/coderay/scanners/ruby.rb
@@ -134,7 +134,7 @@ module CodeRay module Scanners
last_state = state # scan one token as normal code, then return here
state = :initial
else
- raise 'else-case # reached; #%p not handled' % peek(1), tokens
+ raise_inspect 'else-case # reached; #%p not handled' % peek(1), tokens
end
when state.paren
@@ -145,7 +145,7 @@ module CodeRay module Scanners
tokens << [match, :function]
else
- raise 'else-case " reached; %p not handled, state = %p' % [match, state], tokens
+ raise_inspect 'else-case " reached; %p not handled, state = %p' % [match, state], tokens
end
next
@@ -178,7 +178,7 @@ module CodeRay module Scanners
type = :comment
regexp_allowed = true
else
- raise 'else-case _ reached, because case %p was not handled' % [matched[0].chr], tokens
+ raise_inspect 'else-case _ reached, because case %p was not handled' % [matched[0].chr], tokens
end
tokens << [match, type]
next
@@ -274,7 +274,7 @@ module CodeRay module Scanners
elsif fancy_allowed and match = scan(/#{FANCY_START}/o)
type, interpreted = *FancyStringType.fetch(self[1]) do
- raise 'Unknown fancy string: %%%p' % k, tokens
+ raise_inspect 'Unknown fancy string: %%%p' % k, tokens
end
tokens << [:open, type]
state = StringState.new type, interpreted, self[2]