public Method

BlueCloth.transform_lists( str, rs )

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

Source Code

# File bluecloth.rb, line 486
def transform_lists( str, rs )
        @log.debug " Transforming lists at %p" % (str[0,100] + '...')

        str.gsub( ListRegexp ) {|list|
                @log.debug "  Found list %p" % list
                bullet = $1
                list_type = (ListMarkerUl.match(bullet) ? "ul" : "ol")
                list.gsub!( /\n{2,}/, "\n\n\n" )

                %{<%s>\n%s</%s>\n} % [
                        list_type,
                        transform_list_items( list, rs ),
                        list_type,
                ]
        }
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.