rename log_warnings to show_warnings

This commit is contained in:
Ashwin Maroli 2017-12-07 23:44:15 +05:30
parent 77852b8838
commit fcb1b410e3
5 changed files with 9 additions and 7 deletions

View File

@ -688,7 +688,7 @@ kramdown:
input: GFM
hard_wrap: false
footnote_nr: 1
log_warnings: false
show_warnings: false
```
## Liquid Options

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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" => {