RDoc::Markup::Verbatim

A section of verbatim text

Public Instance Methods

accept(visitor) click to toggle source
   # File lib/rdoc/markup/verbatim.rb, line 6
6:   def accept visitor
7:     visitor.accept_verbatim self
8:   end
normalize() click to toggle source

Collapses 3+ newlines into two newlines

    # File lib/rdoc/markup/verbatim.rb, line 13
13:   def normalize
14:     parts = []
15: 
16:     newlines = 0
17: 
18:     @parts.each do |part|
19:       case part
20:       when /\n/ then
21:         newlines += 1
22:         parts << part if newlines <= 2
23:       else
24:         newlines = 0
25:         parts << part
26:       end
27:     end
28: 
29:     parts.slice!(1) if parts[2..1] == ["\n", "\n"]
30: 
31:     @parts = parts
32:   end
text() click to toggle source

The text of the section

    # File lib/rdoc/markup/verbatim.rb, line 37
37:   def text
38:     @parts.join
39:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.