diff options
| author | Mark Otto <[email protected]> | 2017-05-30 08:46:33 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-05-30 08:46:33 -0700 |
| commit | d4eb0d4e739477fc51421eed29906addfd998a04 (patch) | |
| tree | 5ffe09c63ac4e522890fc7b2b87c0a47b0f1a971 /_plugins/markdown-block.rb | |
| parent | 0c12ccbeb6fdf0dd3818f97260aa43c79108d377 (diff) | |
| parent | f95cbc5950bf31995f33023014c47a61665ffacc (diff) | |
| download | bootstrap-d4eb0d4e739477fc51421eed29906addfd998a04.tar.xz bootstrap-d4eb0d4e739477fc51421eed29906addfd998a04.zip | |
Merge branch 'v4-docs-streamlined' of https://github.com/twbs/bootstrap into v4-docs-streamlined
Diffstat (limited to '_plugins/markdown-block.rb')
| -rw-r--r-- | _plugins/markdown-block.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/_plugins/markdown-block.rb b/_plugins/markdown-block.rb new file mode 100644 index 000000000..f9f1531b5 --- /dev/null +++ b/_plugins/markdown-block.rb @@ -0,0 +1,20 @@ +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) |
