public Method

BlueCloth.transform_block_quotes( str, rs )

Transform Markdown-style blockquotes in a copy of the specified str and return it.

Source Code

# File bluecloth.rb, line 582
def transform_block_quotes( str, rs )
        @log.debug " Transforming block quotes"

        str.gsub( BlockQuoteRegexp ) {|quote|
                @log.debug "Making blockquote from %p" % quote

                quote.gsub!( /^ *> ?/, '' ) # Trim one level of quoting 
                quote.gsub!( /^ +$/, '' )    # Trim whitespace-only lines

                indent = " " * TabWidth
                quoted = %{<blockquote>\n%s\n</blockquote>\n\n} %
                        apply_block_transforms( quote, rs ).
                        gsub( /^/, indent ).
                        gsub( PreChunk ) {|m| m.gsub(/^#{indent}/o, '') }
                @log.debug "Blockquoted chunk is: %p" % quoted
                quoted
        }
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.