Method: CodeRay::Encoders::HTML2#finish

Defined in:
lib/milkode/cdweb/lib/coderay_html2.rb

#finish(options) ⇒ Object

ref

CodeRay::Encoders::HTML#finish (coderay-1.0.5/lib/coderay/encoders/html.rb:219)



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/milkode/cdweb/lib/coderay_html2.rb', line 23

def finish options
  @out = ornament_line_attr(options)

  unless @opened.empty?
    warn '%d tokens still open: %p' % [@opened.size, @opened] if $CODERAY_DEBUG
    @out << '</span>' while @opened.pop
    @last_opened = nil
  end
  
  @out.extend Output
  @out.css = @css
  if options[:line_numbers]
    # Numbering.number! @out, options[:line_numbers], options
    HTML2::number! @out, options[:line_numbers], options
  end
  @out.wrap! options[:wrap]
  @out.apply_title! options[:title]
  
  if defined?(@real_out) && @real_out
    @real_out << @out
    @out = @real_out
  end
  
  @out
end