Skip to content

Commit

Permalink
Optimize Kramdown::JekyllDocument#to_html calls (#8041)
Browse files Browse the repository at this point in the history
Merge pull request 8041
  • Loading branch information
ashmaroli committed Mar 26, 2020
1 parent ef6b382 commit 237d08a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/jekyll/converters/markdown/kramdown_parser.rb
Expand Up @@ -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

Expand Down

0 comments on commit 237d08a

Please sign in to comment.