Santize @config['highlighter'] to only allow highlighters supported by kramdown
This commit is contained in:
parent
9d1641f163
commit
e5279d4773
|
@ -5,7 +5,11 @@ module Jekyll
|
|||
def initialize(config)
|
||||
require 'kramdown'
|
||||
@config = config
|
||||
@config['kramdown']['syntax_highlighter'] ||= @config['highlighter']
|
||||
# If kramdown supported highlighter enabled, use that
|
||||
highlighter = @config['highlighter']
|
||||
if highlighter == 'rouge' || highlighter == 'coderay'
|
||||
@config['kramdown']['syntax_highlighter'] ||= highlighter
|
||||
end
|
||||
rescue LoadError
|
||||
STDERR.puts 'You are missing a library required for Markdown. Please run:'
|
||||
STDERR.puts ' $ [sudo] gem install kramdown'
|
||||
|
|
Loading…
Reference in New Issue