vendor/gems/BlueCloth-1.0.0/lib/bluecloth.rb
### Replace all blocks of HTML in +str+ that start in the left margin with
### tokens.
Replace all blocks of HTML in +str+ that start in the left margin with
tokens.
Replace all blocks of HTML in + str + that start in the left margin with tokens .
def hide_html_blocks( str, rs )
		@log.debug "Hiding HTML blocks in %p" % str
		tokenize = lambda {|match|
			key = Digest::MD5::hexdigest( match )
			rs.html_blocks[ key ] = match
			@log.debug "Replacing %p with %p" % [ match, key ]
			"\n\n#{key}\n\n"
		}
		rval = str.dup
		@log.debug "Finding blocks with the strict regex..."
		rval.gsub!( StrictBlockRegex, &tokenize )
		@log.debug "Finding blocks with the loose regex..."
		rval.gsub!( LooseBlockRegex, &tokenize )
		@log.debug "Finding hrules..."
		rval.gsub!( HruleBlockRegex ) {|match| $1 + tokenize[$2] }
		return rval
	end
def hide_html_blocks ( str , rs ) @log . debug "Hiding HTML blocks in %p" % str tokenize = lambda { | match | key = Digest :: MD5 :: hexdigest ( match ) rs . html_blocks [ key ] = match @log . debug "Replacing %p with %p" % [ match , key ] "\n\n#{key}\n\n" } rval = str . dup @log . debug "Finding blocks with the strict regex..." rval . gsub! ( StrictBlockRegex , & tokenize ) @log . debug "Finding blocks with the loose regex..." rval . gsub! ( LooseBlockRegex , & tokenize ) @log . debug "Finding hrules..." rval . gsub! ( HruleBlockRegex ) { | match | $1 + tokenize [ $2 ] } return rval end
Replace all blocks of HTML in +str+ that start in the left margin with
tokens.
Replace all blocks of HTML in + str + that start in the left margin with tokens .
# Tokenizer proc to pass to gsub
str
<not_specific>
rs
<not_specific>