Permalink
Browse files

Merge branch 'ashmaroli-kramdown-warning-config'

  • Loading branch information...
DirtyF committed Dec 7, 2017
2 parents 3efb1ad + 28e20b9 commit 23c3484660d3eb4750fb48e990cacc9d4f9ccb8e
@@ -688,6 +688,7 @@ kramdown:
input: GFM
hard_wrap: false
footnote_nr: 1
show_warnings: false
```
## Liquid Options
@@ -80,6 +80,7 @@ class Configuration < Hash
"input" => "GFM",
"hard_wrap" => false,
"footnote_nr" => 1,
"show_warnings" => false,
},
}.map { |k, v| [k, v.freeze] }].freeze
@@ -39,8 +39,10 @@ def setup
def convert(content)
document = Kramdown::Document.new(content, @config)
html_output = document.to_html
document.warnings.each do |warning|
Jekyll.logger.warn "Kramdown warning:", warning
if @config["show_warnings"]
document.warnings.each do |warning|
Jekyll.logger.warn "Kramdown warning:", warning
end
end
html_output
end
@@ -36,8 +36,10 @@ def output_ext(_)
def convert(content)
document = Kramdown::Document.new(content, @config)
html_output = document.to_html.chomp
document.warnings.each do |warning|
Jekyll.logger.warn "Kramdown warning:", warning
if @config["show_warnings"]
document.warnings.each do |warning|
Jekyll.logger.warn "Kramdown warning:", warning.sub(%r!^Warning:\s+!, "")
end
end
html_output
end
View
@@ -13,6 +13,7 @@ class TestKramdown < JekyllUnitTest
"toc_levels" => "1..6",
"auto_ids" => false,
"footnote_nr" => 1,
"show_warnings" => true,
"syntax_highlighter" => "rouge",
"syntax_highlighter_opts" => {

0 comments on commit 23c3484

Please sign in to comment.