Rubocop: lib/jekyll/converters/markdown/kramdown_parser.rb
This commit is contained in:
parent
38eb326b7f
commit
0880dc097f
|
@ -24,7 +24,8 @@ module Jekyll
|
||||||
|
|
||||||
# Setup and normalize the configuration:
|
# Setup and normalize the configuration:
|
||||||
# * Create Kramdown if it doesn't exist.
|
# * Create Kramdown if it doesn't exist.
|
||||||
# * Set syntax_highlighter, detecting enable_coderay and merging highlighter if none.
|
# * Set syntax_highlighter, detecting enable_coderay and merging
|
||||||
|
# highlighter if none.
|
||||||
# * Merge kramdown[coderay] into syntax_highlighter_opts stripping coderay_.
|
# * Merge kramdown[coderay] into syntax_highlighter_opts stripping coderay_.
|
||||||
# * Make sure `syntax_highlighter_opts` exists.
|
# * Make sure `syntax_highlighter_opts` exists.
|
||||||
|
|
||||||
|
@ -52,7 +53,9 @@ module Jekyll
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# config[kramdown][syntax_higlighter] > config[kramdown][enable_coderay] > config[highlighter]
|
# config[kramdown][syntax_higlighter] >
|
||||||
|
# config[kramdown][enable_coderay] >
|
||||||
|
# config[highlighter]
|
||||||
# Where `enable_coderay` is now deprecated because Kramdown
|
# Where `enable_coderay` is now deprecated because Kramdown
|
||||||
# supports Rouge now too.
|
# supports Rouge now too.
|
||||||
|
|
||||||
|
@ -68,8 +71,10 @@ module Jekyll
|
||||||
|
|
||||||
@highlighter = begin
|
@highlighter = begin
|
||||||
if @config.key?("enable_coderay") && @config["enable_coderay"]
|
if @config.key?("enable_coderay") && @config["enable_coderay"]
|
||||||
Jekyll::Deprecator.deprecation_message "You are using 'enable_coderay', " \
|
Jekyll::Deprecator.deprecation_message(
|
||||||
|
"You are using 'enable_coderay', " \
|
||||||
"use syntax_highlighter: coderay in your configuration file."
|
"use syntax_highlighter: coderay in your configuration file."
|
||||||
|
)
|
||||||
|
|
||||||
"coderay"
|
"coderay"
|
||||||
else
|
else
|
||||||
|
@ -100,8 +105,10 @@ module Jekyll
|
||||||
private
|
private
|
||||||
def modernize_coderay_config
|
def modernize_coderay_config
|
||||||
if highlighter == "coderay"
|
if highlighter == "coderay"
|
||||||
Jekyll::Deprecator.deprecation_message "You are using 'kramdown.coderay' in your configuration, " \
|
Jekyll::Deprecator.deprecation_message(
|
||||||
|
"You are using 'kramdown.coderay' in your configuration, " \
|
||||||
"please use 'syntax_highlighter_opts' instead."
|
"please use 'syntax_highlighter_opts' instead."
|
||||||
|
)
|
||||||
|
|
||||||
@config["syntax_highlighter_opts"] = begin
|
@config["syntax_highlighter_opts"] = begin
|
||||||
strip_coderay_prefix(
|
strip_coderay_prefix(
|
||||||
|
|
Loading…
Reference in New Issue