Merge remote-tracking branch 'mjschultz/master'

Conflicts:
	lib/jekyll/filters.rb
This commit is contained in:
Tom Preston-Werner 2011-05-30 12:27:11 -07:00
commit cae0eaf19c
2 changed files with 13 additions and 0 deletions

View File

@ -12,6 +12,15 @@ module Jekyll
TextileConverter.new.convert(input) TextileConverter.new.convert(input)
end end
# Convert a Markdown string into HTML output using RDiscount.
#
# input - The Markdown String to convert.
#
# Returns the HTML formatted String.
def rdiscount(input)
RDiscount.new(input).to_html
end
# Format a date in short format e.g. "27 Jan 2011". # Format a date in short format e.g. "27 Jan 2011".
# #
# date - the Time to format. # date - the Time to format.

View File

@ -14,6 +14,10 @@ class TestFilters < Test::Unit::TestCase
assert_equal "<p>something <strong>really</strong> simple</p>", @filter.textilize("something *really* simple") assert_equal "<p>something <strong>really</strong> simple</p>", @filter.textilize("something *really* simple")
end end
should "rdiscount with simple string" do
assert_equal "<p>something <strong>really</strong> simple</p>\n", @filter.rdiscount("something **really** simple")
end
should "convert array to sentence string with no args" do should "convert array to sentence string with no args" do
assert_equal "", @filter.array_to_sentence_string([]) assert_equal "", @filter.array_to_sentence_string([])
end end