Merge pull request #3237 from jekyll/enable_coderay

This commit is contained in:
Parker Moore 2014-12-26 22:22:15 -05:00
commit 990a9e6e6d
4 changed files with 21 additions and 15 deletions

View File

@ -80,7 +80,7 @@ module Jekyll
'entity_output' => 'as_char',
'toc_levels' => '1..6',
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
'use_coderay' => false,
'enable_coderay' => false,
'coderay' => {
'coderay_wrap' => 'div',
@ -254,6 +254,12 @@ module Jekyll
config[option].map!(&:to_s)
end
if (config['kramdown'] || {}).key?('use_coderay')
Jekyll::Deprecator.deprecation_message "Please change 'use_coderay'" +
" to 'enable_coderay' in your configuration file."
config['kramdown']['use_coderay'] = config['kramdown'].delete('enable_coderay')
end
if config.fetch('markdown', 'kramdown').to_s.downcase.eql?("maruku")
Jekyll::Deprecator.deprecation_message "You're using the 'maruku' " +
"Markdown processor. Maruku support has been deprecated and will " +

View File

@ -13,14 +13,14 @@ module Jekyll
def convert(content)
# Check for use of coderay
if @config['kramdown']['use_coderay']
if @config['kramdown']['enable_coderay']
%w[wrap line_numbers line_numbers_start tab_width bold_every css default_lang].each do |opt|
key = "coderay_#{opt}"
@config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].key?(key)
end
end
Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config["kramdown"])).to_html
Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config['kramdown'])).to_html
end
end

View File

@ -532,7 +532,7 @@ kramdown:
entity_output: as_char
toc_levels: 1..6
smart_quotes: lsquo,rsquo,ldquo,rdquo
use_coderay: false
enable_coderay: false
coderay:
coderay_wrap: div

View File

@ -14,7 +14,7 @@ class TestKramdown < Test::Unit::TestCase
'toc_levels' => '1..6',
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
'use_coderay' => true,
'enable_coderay' => true,
'coderay_bold_every'=> 12,
'coderay' => {
'coderay_css' => :style,