Skip to content

Commit

Permalink
Merge remote-tracking branch 'mjschultz/master'
Browse files Browse the repository at this point in the history
Conflicts:
	lib/jekyll/filters.rb
  • Loading branch information
mojombo committed May 30, 2011
2 parents 70b1112 + 9e3ad69 commit cae0eaf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/jekyll/filters.rb
Expand Up @@ -12,6 +12,15 @@ def textilize(input)
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.
Expand Down
4 changes: 4 additions & 0 deletions test/test_filters.rb
Expand Up @@ -14,6 +14,10 @@ class JekyllFilter
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
Expand Down

0 comments on commit cae0eaf

Please sign in to comment.