Skip to content

Instantly share code, notes, and snippets.

@parkr
Last active December 19, 2015 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parkr/5992482 to your computer and use it in GitHub Desktop.
Save parkr/5992482 to your computer and use it in GitHub Desktop.
# if doc.to_* returns a Kramdown::Document:
configs = @config["kramdown"].symbolize_keys
doc = Kramdown::Document.new(content, configs)
doc = doc.to_html
if configs.has_key?(:remove_block_html_tags) || configs.has_key?(:remove_span_html_tags)
doc = doc.to_remove_html_tags
end
doc
# if doc.to_* returns a string
configs = @config["kramdown"].symbolize_keys
doc = Kramdown::Document.new(content, configs)
output = doc.to_html
if configs.has_key?(:remove_block_html_tags) || configs.has_key?(:remove_span_html_tags)
output += doc.to_remove_html_tags
end
output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment