- added rdiscount filter for templating system (like the textilize filter, but for markdown)
This commit is contained in:
parent
b3634b522a
commit
9e3ad69922
|
@ -7,6 +7,10 @@ module Jekyll
|
||||||
TextileConverter.new.convert(input)
|
TextileConverter.new.convert(input)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def rdiscount(input)
|
||||||
|
RDiscount.new(input).to_html
|
||||||
|
end
|
||||||
|
|
||||||
def date_to_string(date)
|
def date_to_string(date)
|
||||||
date.strftime("%d %b %Y")
|
date.strftime("%d %b %Y")
|
||||||
end
|
end
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue