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