2010-04-01 03:45:16 -04:00
|
|
|
##
|
|
|
|
# A Paragraph of text
|
|
|
|
|
2010-04-26 23:45:22 -04:00
|
|
|
class RDoc::Markup::Paragraph < RDoc::Markup::Raw
|
2010-04-01 03:45:16 -04:00
|
|
|
|
2010-12-19 22:22:49 -05:00
|
|
|
##
|
|
|
|
# Calls #accept_paragraph on +visitor+
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
def accept visitor
|
|
|
|
visitor.accept_paragraph self
|
|
|
|
end
|
|
|
|
|
2012-11-26 23:28:14 -05:00
|
|
|
##
|
|
|
|
# Joins the raw paragraph text and converts inline HardBreaks to the
|
|
|
|
# +hard_break+ text.
|
|
|
|
|
|
|
|
def text hard_break = ''
|
|
|
|
@parts.map do |part|
|
|
|
|
if RDoc::Markup::HardBreak === part then
|
|
|
|
hard_break
|
|
|
|
else
|
|
|
|
part
|
|
|
|
end
|
|
|
|
end.join
|
|
|
|
end
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
end
|
|
|
|
|