Remove patch to modify config for kramdown (#7699)
Merge pull request 7699
This commit is contained in:
parent
c87f5fa7fa
commit
3e8e6d22d7
|
@ -34,7 +34,6 @@ module Jekyll
|
||||||
@config["syntax_highlighter_opts"]["guess_lang"] = @config["guess_lang"]
|
@config["syntax_highlighter_opts"]["guess_lang"] = @config["guess_lang"]
|
||||||
@config["coderay"] ||= {} # XXX: Legacy.
|
@config["coderay"] ||= {} # XXX: Legacy.
|
||||||
modernize_coderay_config
|
modernize_coderay_config
|
||||||
make_accessible
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def convert(content)
|
def convert(content)
|
||||||
|
@ -64,13 +63,6 @@ module Jekyll
|
||||||
end
|
end
|
||||||
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][syntax_higlighter] >
|
||||||
# config[kramdown][enable_coderay] >
|
# config[kramdown][enable_coderay] >
|
||||||
# config[highlighter]
|
# config[highlighter]
|
||||||
|
|
|
@ -22,6 +22,7 @@ class TestKramdown < JekyllUnitTest
|
||||||
"css" => :class,
|
"css" => :class,
|
||||||
"css_class" => "highlight",
|
"css_class" => "highlight",
|
||||||
"formatter" => ::Rouge::Formatters::HTMLLegacy,
|
"formatter" => ::Rouge::Formatters::HTMLLegacy,
|
||||||
|
"foobar" => "lipsum",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -35,24 +36,10 @@ class TestKramdown < JekyllUnitTest
|
||||||
Jekyll::Cache.clear
|
Jekyll::Cache.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
should "fill symbolized keys into config for compatibility with kramdown" do
|
should "not break kramdown" do
|
||||||
kramdown_config = @markdown.instance_variable_get(:@parser)
|
kramdown_doc = Kramdown::Document.new("# Some Header #", @config["kramdown"])
|
||||||
.instance_variable_get(:@config)
|
assert_equal :class, kramdown_doc.options[:syntax_highlighter_opts][:css]
|
||||||
|
assert_equal "lipsum", kramdown_doc.options[:syntax_highlighter_opts][:foobar]
|
||||||
@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]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
should "run Kramdown" do
|
should "run Kramdown" do
|
||||||
|
|
Loading…
Reference in New Issue