mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 09:18:11 -05:00
Santize @config['highlighter'] to only allow highlighters supported by kramdown
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user