Wrap all remaining paragraph-looking text in a copy of str inside <p> tags and return it.</p>
Source Code
# File bluecloth.rb, line 716 def form_paragraphs( str, rs ) @log.debug " Forming paragraphs" grafs = str. sub( /\A\n+/, '' ). sub( /\n+\z/, '' ). split( /\n{2,}/ ) rval = grafs.collect {|graf| # Unhashify HTML blocks if this is a placeholder if rs.html_blocks.key?( graf ) rs.html_blocks[ graf ] # Otherwise, wrap in <p> tags else apply_span_transforms(graf, rs). sub( /^[ ]*/, '<p>' ) + '</p>' end }.join( "\n\n" ) @log.debug " Formed paragraphs: %p" % rval return rval end
<code/>and<pre/>for code samples.