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
|
class Kramdown::Parser::SmartyPants < Kramdown::Parser::Kramdown
|
||||||
def initialize(source, options)
|
def initialize(source, options)
|
||||||
super
|
super
|
||||||
@block_parsers = [:block_html]
|
@block_parsers = [:block_html, :content]
|
||||||
@span_parsers = [:smart_quotes, :html_entity, :typographic_syms, :span_html]
|
@span_parsers = [:smart_quotes, :html_entity, :typographic_syms, :span_html]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def parse_content
|
||||||
|
add_text @src.scan(%r!\A.*\n!)
|
||||||
|
end
|
||||||
|
define_parser(:content, %r!\A!)
|
||||||
end
|
end
|
||||||
|
|
||||||
module Jekyll
|
module Jekyll
|
||||||
|
|
|
@ -100,6 +100,10 @@ class TestFilters < JekyllUnitTest
|
||||||
assert_equal "“", @filter.smartify("“")
|
assert_equal "“", @filter.smartify("“")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "convert multiple lines" do
|
||||||
|
assert_equal "…\n…", @filter.smartify("...\n...")
|
||||||
|
end
|
||||||
|
|
||||||
should "allow raw HTML passthrough" do
|
should "allow raw HTML passthrough" do
|
||||||
assert_equal(
|
assert_equal(
|
||||||
"Span HTML is <em>not</em> escaped",
|
"Span HTML is <em>not</em> escaped",
|
||||||
|
@ -123,6 +127,12 @@ class TestFilters < JekyllUnitTest
|
||||||
@filter.smartify(404)
|
@filter.smartify(404)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "not output any warnings" do
|
||||||
|
assert_empty(
|
||||||
|
capture_output { @filter.smartify("Test") }
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
should "sassify with simple string" do
|
should "sassify with simple string" do
|
||||||
|
|
Loading…
Reference in New Issue