Avoid block parser warning in SmartyPants (#6565)
Merge pull request 6565
This commit is contained in:
parent
04f4e891f0
commit
2c646a304c
|
@ -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
|
||||
|
|
|
@ -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 <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
|
||||
|
|
Loading…
Reference in New Issue