Project

General

Profile

Feature #3359 » r710-patch_r3078.patch

Patch against trunk at r3078. - Mischa The Evil, 2009-11-22 16:50

View differences:

vendor/plugins/coderay-0.9.0/lib/coderay/encoders/html.rb (working copy)
#
# == Options
#
# === :escape
# Escape html entities
# Default: true
#
# === :tab_width
# Convert \t characters to +n+ spaces (a number.)
# Default: 8
......
FILE_EXTENSION = 'html'
DEFAULT_OPTIONS = {
:escape => true,
:tab_width => 8,
# :level => :xhtml, # reserved for future use
......
@HTML_ESCAPE = HTML_ESCAPE.dup
@HTML_ESCAPE["\t"] = ' ' * options[:tab_width]
@escape = options[:escape]
@opened = [nil]
@css = CSS.new options[:style]
......
# raise 'Token with nil as text was given: %p' % [[text, type]]
when String
if text =~ /#{HTML_ESCAPE_PATTERN}/o
if @escape && (text =~ /#{HTML_ESCAPE_PATTERN}/o)
text = text.gsub(/#{HTML_ESCAPE_PATTERN}/o) { |m| @HTML_ESCAPE[m] }
end
@opened[0] = type
(3-3/4)