Rubocop: lib/jekyll/converters/markdown/kramdown_parser.rb

This commit is contained in:
Pat Hawks 2016-05-26 00:53:26 -05:00
parent 38eb326b7f
commit 0880dc097f
1 changed files with 11 additions and 4 deletions

View File

@ -24,7 +24,8 @@ module Jekyll
# Setup and normalize the configuration:
# * 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_.
# * Make sure `syntax_highlighter_opts` exists.
@ -52,7 +53,9 @@ module Jekyll
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
# supports Rouge now too.
@ -68,8 +71,10 @@ module Jekyll
@highlighter = begin
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."
)
"coderay"
else
@ -100,8 +105,10 @@ module Jekyll
private
def modernize_coderay_config
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."
)
@config["syntax_highlighter_opts"] = begin
strip_coderay_prefix(