KramdownConverter: clean up some source with some unified methods
This commit is contained in:
parent
e331a37260
commit
fe13c3b366
2
Gemfile
2
Gemfile
|
@ -20,7 +20,7 @@ group :test do
|
||||||
gem 'minitest-profile'
|
gem 'minitest-profile'
|
||||||
gem 'rspec-mocks'
|
gem 'rspec-mocks'
|
||||||
gem 'minitest'
|
gem 'minitest'
|
||||||
gem "nokogiri"
|
gem 'nokogiri'
|
||||||
|
|
||||||
if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2")
|
if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2")
|
||||||
gem 'test-unit'
|
gem 'test-unit'
|
||||||
|
|
|
@ -47,7 +47,7 @@ module Jekyll
|
||||||
@highlighter ||= begin
|
@highlighter ||= begin
|
||||||
if highlighter = @config["syntax_highlighter"] then highlighter
|
if highlighter = @config["syntax_highlighter"] then highlighter
|
||||||
elsif @config.key?("enable_coderay") && @config["enable_coderay"]
|
elsif @config.key?("enable_coderay") && @config["enable_coderay"]
|
||||||
Jekyll.logger.warn "DEPRECATION: You are using 'enable_coderay', use syntax_highlighter: coderay."
|
Jekyll::Deprecator.deprecation_message "You are using 'enable_coderay', use syntax_highlighter: coderay in your configuration file."
|
||||||
"coderay"
|
"coderay"
|
||||||
else
|
else
|
||||||
@main_fallback_highlighter
|
@main_fallback_highlighter
|
||||||
|
@ -59,7 +59,7 @@ module Jekyll
|
||||||
def strip_coderay_prefix(hash)
|
def strip_coderay_prefix(hash)
|
||||||
hash.each_with_object({}) do |(key, val), hsh|
|
hash.each_with_object({}) do |(key, val), hsh|
|
||||||
cleaned_key = key.gsub(/\Acoderay_/, "")
|
cleaned_key = key.gsub(/\Acoderay_/, "")
|
||||||
Jekyll.logger.warn "You are using '#{key}'. Normalizing to #{cleaned_key}." if key != cleaned_key
|
Jekyll::Deprecator.deprecation_message "You are using '#{key}'. Normalizing to #{cleaned_key}." if key != cleaned_key
|
||||||
hsh[cleaned_key] = val
|
hsh[cleaned_key] = val
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -71,7 +71,7 @@ module Jekyll
|
||||||
private
|
private
|
||||||
def modernize_coderay_config
|
def modernize_coderay_config
|
||||||
if highlighter == "coderay"
|
if highlighter == "coderay"
|
||||||
Jekyll.logger.warn "DEPRECATION: kramdown.coderay is deprecated use syntax_highlighter_opts."
|
Jekyll::Deprecator.deprecation_message "You are using 'kramdown.coderay' in your configuration, please use 'syntax_highlighter_opts' instead."
|
||||||
@config["syntax_highlighter_opts"] = begin
|
@config["syntax_highlighter_opts"] = begin
|
||||||
strip_coderay_prefix(
|
strip_coderay_prefix(
|
||||||
@config["syntax_highlighter_opts"] \
|
@config["syntax_highlighter_opts"] \
|
||||||
|
|
Loading…
Reference in New Issue