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:
maul.esel 2013-04-11 21:02:08 +02:00
parent b10e06ce47
commit bcda51f97b
3 changed files with 8 additions and 4 deletions

View File

@ -89,7 +89,11 @@ module Jekyll
#
# Returns excerpt string.
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
# Compares Post objects. First compares the Post date. If the dates are

View File

@ -1,6 +1,6 @@
---
layout: ~
excerpt: 'I can set a custom excerpt with *markdown*'
excerpt: 'I can set a custom excerpt'
---
This is not my excerpt.

View File

@ -329,11 +329,11 @@ class TestPost < Test::Unit::TestCase
end
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
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