summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/html.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2006-03-21 14:46:34 +0000
committermurphy <murphy@rubychan.de>2006-03-21 14:46:34 +0000
commita3b4ad06b992bd418a1d34bfb271c09fd9bedf11 (patch)
tree722d341f4065b4614b2cfc55cee6ccd3c66fb69a /lib/coderay/encoders/html.rb
parent13255135d7539fd542cf831d6a98f1ba8a5d43ae (diff)
downloadcoderay-a3b4ad06b992bd418a1d34bfb271c09fd9bedf11.tar.gz
CodeRay::Duo added for cool caching!
bench/caching.rb added t“for demonstrating this. HTML Encoder: creates unwrapped output by default (still problems with that.) Numerizing changed (doesn't try to prevent nesting errors) Speedup: "::String" is faster.
Diffstat (limited to 'lib/coderay/encoders/html.rb')
-rw-r--r--lib/coderay/encoders/html.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb
index b75f9e5..11fa84c 100644
--- a/lib/coderay/encoders/html.rb
+++ b/lib/coderay/encoders/html.rb
@@ -36,7 +36,7 @@ module Encoders
#
# You can also use Encoders::Div and Encoders::Span.
#
- # Default: :page
+ # Default: nil
#
# === :line_numbers
# Include line numbers in :table, :inline, :list or nil (no line numbers)
@@ -73,7 +73,7 @@ module Encoders
:style => :cycnus,
- :wrap => :page,
+ :wrap => nil,
:line_numbers => nil,
:line_number_start => 1,
@@ -208,17 +208,14 @@ module Encoders
@out.extend Output
@out.css = @css
- @out.numerize! options[:line_numbers], options # if options[:line_numbers]
- @out.wrap! options[:wrap] # if options[:wrap]
-
- #require 'pp'
- #pp @css_style, @css_style.size
+ @out.numerize! options[:line_numbers], options
+ @out.wrap! options[:wrap]
super
end
def token text, type
- if text.is_a? String
+ if text.is_a? ::String
if text =~ /#{HTML_ESCAPE_PATTERN}/o
text = text.gsub(/#{HTML_ESCAPE_PATTERN}/o) { |m| @HTML_ESCAPE[m] }
end