From 774bf07380c3c84fc535ecea1dbd236048b96300 Mon Sep 17 00:00:00 2001 From: zachgersh Date: Sun, 9 Jun 2013 21:46:17 -0700 Subject: [PATCH 1/3] Supporting more kramdown options. --- lib/jekyll/converters/markdown/kramdown_parser.rb | 2 +- lib/jekyll/core_ext.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/converters/markdown/kramdown_parser.rb b/lib/jekyll/converters/markdown/kramdown_parser.rb index 58857276..25e119b2 100644 --- a/lib/jekyll/converters/markdown/kramdown_parser.rb +++ b/lib/jekyll/converters/markdown/kramdown_parser.rb @@ -26,7 +26,7 @@ module Jekyll # not using coderay base_kramdown_configs end - Kramdown::Document.new(content, kramdown_configs).to_html + Kramdown::Document.new(content, @config["kramdown"].symbolize_keys).to_html end def base_kramdown_configs diff --git a/lib/jekyll/core_ext.rb b/lib/jekyll/core_ext.rb index b1192cf4..00f64fcf 100644 --- a/lib/jekyll/core_ext.rb +++ b/lib/jekyll/core_ext.rb @@ -41,6 +41,17 @@ class Hash end array || [] end + + def symbolize_keys! + keys.each do |key| + self[(key.to_sym rescue key) || key] = delete(key) + end + self + end + + def symbolize_keys + dup.symbolize_keys! + end end # Thanks, ActiveSupport! From 90500f37ac29dcb6c43294fabb2d86a27d05843c Mon Sep 17 00:00:00 2001 From: zachgersh Date: Sun, 14 Jul 2013 00:24:49 -0500 Subject: [PATCH 2/3] Deleted unused code. --- lib/jekyll/converters/markdown/kramdown_parser.rb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/jekyll/converters/markdown/kramdown_parser.rb b/lib/jekyll/converters/markdown/kramdown_parser.rb index 25e119b2..45542c66 100644 --- a/lib/jekyll/converters/markdown/kramdown_parser.rb +++ b/lib/jekyll/converters/markdown/kramdown_parser.rb @@ -13,7 +13,7 @@ module Jekyll def convert(content) # Check for use of coderay - kramdown_configs = if @config['kramdown']['use_coderay'] + if @config['kramdown']['use_coderay'] base_kramdown_configs.merge({ :coderay_wrap => @config['kramdown']['coderay']['coderay_wrap'], :coderay_line_numbers => @config['kramdown']['coderay']['coderay_line_numbers'], @@ -22,22 +22,11 @@ module Jekyll :coderay_bold_every => @config['kramdown']['coderay']['coderay_bold_every'], :coderay_css => @config['kramdown']['coderay']['coderay_css'] }) - else - # not using coderay - base_kramdown_configs end + Kramdown::Document.new(content, @config["kramdown"].symbolize_keys).to_html end - def base_kramdown_configs - { - :auto_ids => @config['kramdown']['auto_ids'], - :footnote_nr => @config['kramdown']['footnote_nr'], - :entity_output => @config['kramdown']['entity_output'], - :toc_levels => @config['kramdown']['toc_levels'], - :smart_quotes => @config['kramdown']['smart_quotes'] - } - end end end end From b0fbfdb87d285e7b049f757ffa473fe33aed2cdd Mon Sep 17 00:00:00 2001 From: zachgersh Date: Sun, 14 Jul 2013 00:32:48 -0500 Subject: [PATCH 3/3] Added a configuration warning to our docs for the two kramdown options we don't support. --- site/docs/configuration.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/site/docs/configuration.md b/site/docs/configuration.md index ffdbf6ef..7a72394f 100644 --- a/site/docs/configuration.md +++ b/site/docs/configuration.md @@ -236,7 +236,16 @@ before your site is served. Jekyll runs with the following configuration options by default. Unless alternative settings for these options are explicitly specified in the -configuration file or on the command-line, Jekyll will run using these options. +[[configuration]] file or on the command-line, Jekyll will run using these options. + +
+
There are two unsupported kramdown options
+

+ Please note that both remove_block_html_tags and + remove_span_html_tags are currently unsupported in jekyll due to the + fact that they are not included within the kramdown HTML converter. +

+
{% highlight yaml %} source: .