diff options
Diffstat (limited to 'docs/_plugins/markdown-block.rb')
| -rw-r--r-- | docs/_plugins/markdown-block.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/_plugins/markdown-block.rb b/docs/_plugins/markdown-block.rb new file mode 100644 index 000000000..6aa761585 --- /dev/null +++ b/docs/_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.getConverterImpl(::Jekyll::Converters::Markdown) + converter.convert(render_block(context)) + end + end +end + +Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock) |
