New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only complain about kramdown.coderay
if it is actually in the config
#5380
Conversation
@@ -104,7 +104,7 @@ def strip_coderay_prefix(hash) | |||
|
|||
private | |||
def modernize_coderay_config | |||
if highlighter == "coderay" | |||
if !@config["coderay"].empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't speak to the wider implications of this change, but as far as style goes, could we use unless
instead of if !
?
I think Rubocop should be complaining about this.
Edit: Sure enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure; fixed.
Don't complain about the deprecated `kramdown.coderay` key when `highlighter == "coderay"`, since that could have been set with the legitimate `syntax_highlighter: coderay` setting. Instead, complain only if the `kramdown.coderay` configuration setting is actually present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ethomson! This LGTM. If I'm following the logic properly, then this message will only fire if the coderay
configuration key is present with some non-empty value. Seem right?
Rubocop errors are fixed on |
@jekyllbot: merge +buf |
Thanks @parkr ! ❤️ |
After upgrading to jekyll 3, I wanted to continue using coderay as my highlighter. So I updated my configuration to:
And I was surprised when jekyll complained:
It seems that jekyll is raising this notice whenever
highlighter == "coderay"
, even when thekramdown.coderay
configuration setting is nonexistent.Switching this to check for a non-empty
kramdown.coderay
hash keeps this warning when the user haskramdown.coderay
settings, but suppresses this warning when the configuration has switched to the new stylekramdown.syntax_highlighter_opts
.