do not allow markdown etc. in excerpt
Adjust the tests accordingly. Also add a message for one of the tests.
This commit is contained in:
parent
b10e06ce47
commit
bcda51f97b
|
@ -89,7 +89,11 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns excerpt string.
|
# Returns excerpt string.
|
||||||
def excerpt
|
def excerpt
|
||||||
self.data['excerpt'] ? converter.convert(self.data['excerpt']) : self.extracted_excerpt
|
if self.data.has_key? 'excerpt'
|
||||||
|
self.data['excerpt']
|
||||||
|
else
|
||||||
|
self.extracted_excerpt
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Compares Post objects. First compares the Post date. If the dates are
|
# Compares Post objects. First compares the Post date. If the dates are
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
layout: ~
|
layout: ~
|
||||||
excerpt: 'I can set a custom excerpt with *markdown*'
|
excerpt: 'I can set a custom excerpt'
|
||||||
---
|
---
|
||||||
|
|
||||||
This is not my excerpt.
|
This is not my excerpt.
|
||||||
|
|
|
@ -329,11 +329,11 @@ class TestPost < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "use custom excerpt" do
|
should "use custom excerpt" do
|
||||||
assert_equal("<p>I can set a custom excerpt with <em>markdown</em></p>", @post.excerpt)
|
assert_equal("I can set a custom excerpt", @post.excerpt)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "expose custom excerpt to liquid" do
|
should "expose custom excerpt to liquid" do
|
||||||
assert @post.content.include?("I can use the excerpt: <quote><p>I can set a custom excerpt with <em>markdown</em></p></quote>")
|
assert @post.content.include?("I can use the excerpt: <quote>I can set a custom excerpt</quote>"), "Exposes incorrect excerpt to liquid."
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue