From fcb1b410e3e93f180312b7a14aa5d1e0f2591c1e Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 7 Dec 2017 23:44:15 +0530 Subject: [PATCH] rename log_warnings to show_warnings --- docs/_docs/configuration.md | 2 +- lib/jekyll/configuration.rb | 2 +- lib/jekyll/converters/markdown/kramdown_parser.rb | 5 +++-- lib/jekyll/converters/smartypants.rb | 5 +++-- test/test_kramdown.rb | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/_docs/configuration.md b/docs/_docs/configuration.md index d5d6ebd7..77b74981 100644 --- a/docs/_docs/configuration.md +++ b/docs/_docs/configuration.md @@ -688,7 +688,7 @@ kramdown: input: GFM hard_wrap: false footnote_nr: 1 - log_warnings: false + show_warnings: false ``` ## Liquid Options diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 3258ffab..423ab658 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -80,7 +80,7 @@ module Jekyll "input" => "GFM", "hard_wrap" => false, "footnote_nr" => 1, - "log_warnings" => false, + "show_warnings" => false, }, }.map { |k, v| [k, v.freeze] }].freeze diff --git a/lib/jekyll/converters/markdown/kramdown_parser.rb b/lib/jekyll/converters/markdown/kramdown_parser.rb index b1015dcc..bb03eaaa 100644 --- a/lib/jekyll/converters/markdown/kramdown_parser.rb +++ b/lib/jekyll/converters/markdown/kramdown_parser.rb @@ -38,12 +38,13 @@ module Jekyll def convert(content) document = Kramdown::Document.new(content, @config) - if @config["log_warnings"] + html_output = document.to_html + if @config["show_warnings"] document.warnings.each do |warning| Jekyll.logger.warn "Kramdown warning:", warning end end - document.to_html + html_output end private diff --git a/lib/jekyll/converters/smartypants.rb b/lib/jekyll/converters/smartypants.rb index 4882c0e4..40c0aecd 100644 --- a/lib/jekyll/converters/smartypants.rb +++ b/lib/jekyll/converters/smartypants.rb @@ -30,12 +30,13 @@ module Jekyll def convert(content) document = Kramdown::Document.new(content, @config) - if @config["log_warnings"] + html_output = document.to_html.chomp + if @config["show_warnings"] document.warnings.each do |warning| Jekyll.logger.warn "Kramdown warning:", warning.sub(%r!^Warning:\s+!, "") end end - document.to_html.chomp + html_output end end end diff --git a/test/test_kramdown.rb b/test/test_kramdown.rb index d40a27e2..f68bb17c 100644 --- a/test/test_kramdown.rb +++ b/test/test_kramdown.rb @@ -13,7 +13,7 @@ class TestKramdown < JekyllUnitTest "toc_levels" => "1..6", "auto_ids" => false, "footnote_nr" => 1, - "log_warnings" => true, + "show_warnings" => true, "syntax_highlighter" => "rouge", "syntax_highlighter_opts" => {