r710-patch_r3078.patch

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

Download (1.19 KB)

View differences:

vendor/plugins/coderay-0.9.0/lib/coderay/encoders/html.rb (working copy)
25 25
  #
26 26
  # == Options
27 27
  #
28
  # === :escape
29
  # Escape html entities
30
  # Default: true
31
  #
28 32
  # === :tab_width
29 33
  # Convert \t characters to +n+ spaces (a number.)
30 34
  # Default: 8
......
86 90
    FILE_EXTENSION = 'html'
87 91

  
88 92
    DEFAULT_OPTIONS = {
93
      :escape => true,
89 94
      :tab_width => 8,
90 95

  
91 96
      # :level => :xhtml,  # reserved for future use
......
162 167
      @HTML_ESCAPE = HTML_ESCAPE.dup
163 168
      @HTML_ESCAPE["\t"] = ' ' * options[:tab_width]
164 169

  
170
      @escape = options[:escape]
165 171
      @opened = [nil]
166 172
      @css = CSS.new options[:style]
167 173

  
......
245 251
        # raise 'Token with nil as text was given: %p' % [[text, type]] 
246 252
      
247 253
      when String
248
        if text =~ /#{HTML_ESCAPE_PATTERN}/o
254
        if @escape && (text =~ /#{HTML_ESCAPE_PATTERN}/o)
249 255
          text = text.gsub(/#{HTML_ESCAPE_PATTERN}/o) { |m| @HTML_ESCAPE[m] }
250 256
        end
251 257
        @opened[0] = type