mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 01:08:26 -05:00
Merge commit 'ee65dadc9a5ae5fc8f19848754f7175ebd630375'
This commit is contained in:
@@ -315,6 +315,12 @@ Convert an array into a sentence.
|
||||
becomes
|
||||
|
||||
foo, bar, and baz
|
||||
|
||||
h3. Textilize
|
||||
|
||||
Convert a Textile-formatted string into HTML, formatted via RedCloth
|
||||
|
||||
{{ page.excerpt | textilize }}
|
||||
|
||||
h3. Include (Tag)
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
module Jekyll
|
||||
|
||||
module Filters
|
||||
def textilize(input)
|
||||
RedCloth.new(input).to_html
|
||||
end
|
||||
|
||||
def date_to_string(date)
|
||||
date.strftime("%d %b %Y")
|
||||
end
|
||||
|
||||
@@ -10,6 +10,10 @@ class TestFilters < Test::Unit::TestCase
|
||||
@filter = JekyllFilter.new
|
||||
end
|
||||
|
||||
def test_textilize_with_simple_string
|
||||
assert_equal "<p>something <strong>really</strong> simple</p>", @filter.textilize("something *really* simple")
|
||||
end
|
||||
|
||||
def test_array_to_sentence_string_with_no_args
|
||||
assert_equal "", @filter.array_to_sentence_string([])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user