diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 47627e7b..14c287bd 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -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 diff --git a/test/source/_posts/2013-04-11-custom-excerpt.markdown b/test/source/_posts/2013-04-11-custom-excerpt.markdown index ff5b721f..023251fe 100644 --- a/test/source/_posts/2013-04-11-custom-excerpt.markdown +++ b/test/source/_posts/2013-04-11-custom-excerpt.markdown @@ -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. diff --git a/test/test_post.rb b/test/test_post.rb index 88d25723..62da1343 100644 --- a/test/test_post.rb +++ b/test/test_post.rb @@ -329,11 +329,11 @@ class TestPost < Test::Unit::TestCase end should "use custom excerpt" do - assert_equal("
I can set a custom excerpt with markdown
", @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:") + assert @post.content.include?("I can use the excerpt:I can set a custom excerpt with markdown
I can set a custom excerpt"), "Exposes incorrect excerpt to liquid." end end