Avoid block parser warning in SmartyPants (#6565)

Merge pull request 6565
This commit is contained in:
jekyllbot 2017-11-17 16:36:11 -05:00 committed by Frank Taillandier
parent 68935f1bda
commit 0fdb39bbd6
No known key found for this signature in database
GPG Key ID: E73258E3F50AEB7E
2 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -100,6 +100,10 @@ class TestFilters < JekyllUnitTest
assert_equal "", @filter.smartify("&ldquo;")
end
should "convert multiple lines" do
assert_equal "\n", @filter.smartify("...\n...")
end
should "allow raw HTML passthrough" do
assert_equal(
"Span HTML is <em>not</em> 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