0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Bootstrap/docs/_plugins/markdown-block.rb
XhmikosR 608dead1fe Update to Jekyll v3.0.0.
[skip sauce]
2015-10-29 08:12:33 +02:00

21 lines
525 B
Ruby

module Jekyll
class MarkdownBlock < Liquid::Block
alias_method :render_block, :render
def initialize(tag_name, markup, tokens)
super
end
# Uses the default Jekyll markdown parser to
# parse the contents of this block
#
def render(context)
site = context.registers[:site]
converter = site.find_converter_instance(::Jekyll::Converters::Markdown)
converter.convert(render_block(context))
end
end
end
Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock)