699: def paragraphs(to_wrap = nil, split_on = /(#{$/}){2}/o)
700: to_wrap = @text if to_wrap.nil?
701: if to_wrap.respond_to?(:split)
702: to_wrap = to_wrap.split(split_on)
703: else
704: to_wrap = [to_wrap].flatten
705: end
706:
707: if ((@first_indent == @body_indent) or @tag_paragraph) then
708: p_end = NEWLINE
709: else
710: p_end = ''
711: end
712:
713: cnt = 0
714: ret = []
715: to_wrap.each do |tw|
716: @tag_cur = @tag_text[cnt] if @tag_paragraph
717: @tag_cur = '' if @tag_cur.nil?
718: line = format(tw)
719: ret << "#{line}#{p_end}" if (not line.nil?) and (line.size > 0)
720: cnt += 1
721: end
722:
723: ret[-1].chomp! unless ret.empty?
724: ret.join('')
725: end