Class: RDoc::Markup::Paragraph

Inherits:
Markup::Raw
  • Object
show all
Defined in:
lib/rdoc/markup/paragraph.rb

Overview

A Paragraph of text

Instance Method Summary collapse

Instance Method Details

#accept(visitor) ⇒ Object

Calls #accept_paragraph on visitor



12
13
14
# File 'lib/rdoc/markup/paragraph.rb', line 12

def accept(visitor)
  visitor.accept_paragraph self
end

#text(hard_break = '') ⇒ Object

Joins the raw paragraph text and converts inline HardBreaks to the hard_break text.



20
21
22
23
24
25
26
27
28
# File 'lib/rdoc/markup/paragraph.rb', line 20

def text(hard_break = '')
  @parts.map do |part|
    if Markup::HardBreak === part
      hard_break
    else
      part
    end
  end.join
end