Skip to content
Permalink
Browse files

Optimize `Kramdown::JekyllDocument#to_html` calls (#8041)

Merge pull request 8041
  • Loading branch information
ashmaroli committed Mar 26, 2020
1 parent ef6b382 commit 237d08a76cc1bf36351e2aedd97fd3246b4c1fb2
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/jekyll/converters/markdown/kramdown_parser.rb
@@ -53,6 +53,16 @@ def initialize(source, options = {})
@options = JekyllDocument.options
@root, @warnings = JekyllDocument.parser.parse(source, @options)
end

# Use Kramdown::Converter::Html class to convert this document into HTML.
#
# The implementation is basically an optimized version of core logic in
# +Kramdown::Document#method_missing+ from kramdown-2.1.0.
def to_html
output, warnings = Kramdown::Converter::Html.convert(@root, @options)
@warnings.concat(warnings)
output
end
end
end

0 comments on commit 237d08a

Please sign in to comment.
You can’t perform that action at this time.