Remove patch to modify config for kramdown (#7699)

Merge pull request 7699
This commit is contained in:
Ashwin Maroli 2019-06-28 16:08:02 +05:30 committed by jekyllbot
parent c87f5fa7fa
commit 3e8e6d22d7
2 changed files with 5 additions and 26 deletions

View File

@ -34,7 +34,6 @@ module Jekyll
@config["syntax_highlighter_opts"]["guess_lang"] = @config["guess_lang"]
@config["coderay"] ||= {} # XXX: Legacy.
modernize_coderay_config
make_accessible
end
def convert(content)
@ -64,13 +63,6 @@ module Jekyll
end
end
def make_accessible(hash = @config)
hash.keys.each do |key|
hash[key.to_sym] = hash[key]
make_accessible(hash[key]) if hash[key].is_a?(Hash)
end
end
# config[kramdown][syntax_higlighter] >
# config[kramdown][enable_coderay] >
# config[highlighter]

View File

@ -22,6 +22,7 @@ class TestKramdown < JekyllUnitTest
"css" => :class,
"css_class" => "highlight",
"formatter" => ::Rouge::Formatters::HTMLLegacy,
"foobar" => "lipsum",
},
},
}
@ -35,24 +36,10 @@ class TestKramdown < JekyllUnitTest
Jekyll::Cache.clear
end
should "fill symbolized keys into config for compatibility with kramdown" do
kramdown_config = @markdown.instance_variable_get(:@parser)
.instance_variable_get(:@config)
@kramdown_config_keys.each do |key|
assert kramdown_config.key?(key.to_sym),
"Expected #{kramdown_config} to include key #{key.to_sym.inspect}"
end
@syntax_highlighter_opts_config_keys.each do |key|
assert kramdown_config["syntax_highlighter_opts"].key?(key.to_sym),
"Expected #{kramdown_config["syntax_highlighter_opts"]} to include " \
"key #{key.to_sym.inspect}"
end
assert_equal kramdown_config["smart_quotes"], kramdown_config[:smart_quotes]
assert_equal kramdown_config["syntax_highlighter_opts"]["css"],
kramdown_config[:syntax_highlighter_opts][:css]
should "not break kramdown" do
kramdown_doc = Kramdown::Document.new("# Some Header #", @config["kramdown"])
assert_equal :class, kramdown_doc.options[:syntax_highlighter_opts][:css]
assert_equal "lipsum", kramdown_doc.options[:syntax_highlighter_opts][:foobar]
end
should "run Kramdown" do