diff --git a/lib/jekyll/converters/smartypants.rb b/lib/jekyll/converters/smartypants.rb index 16161e1d..6d7c994b 100644 --- a/lib/jekyll/converters/smartypants.rb +++ b/lib/jekyll/converters/smartypants.rb @@ -3,9 +3,14 @@ class Kramdown::Parser::SmartyPants < Kramdown::Parser::Kramdown def initialize(source, options) super - @block_parsers = [:block_html] + @block_parsers = [:block_html, :content] @span_parsers = [:smart_quotes, :html_entity, :typographic_syms, :span_html] end + + def parse_content + add_text @src.scan(%r!\A.*\n!) + end + define_parser(:content, %r!\A!) end module Jekyll diff --git a/test/test_filters.rb b/test/test_filters.rb index a56df6da..afedf746 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -100,6 +100,10 @@ class TestFilters < JekyllUnitTest assert_equal "“", @filter.smartify("“") end + should "convert multiple lines" do + assert_equal "…\n…", @filter.smartify("...\n...") + end + should "allow raw HTML passthrough" do assert_equal( "Span HTML is not escaped", @@ -123,6 +127,12 @@ class TestFilters < JekyllUnitTest @filter.smartify(404) ) end + + should "not output any warnings" do + assert_empty( + capture_output { @filter.smartify("Test") } + ) + end end should "sassify with simple string" do