diff options
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/common/thirdparty/bootstrap/_plugins/markdown-block.rb')
-rw-r--r-- | vnfmarket/src/main/webapp/vnfmarket/common/thirdparty/bootstrap/_plugins/markdown-block.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/common/thirdparty/bootstrap/_plugins/markdown-block.rb b/vnfmarket/src/main/webapp/vnfmarket/common/thirdparty/bootstrap/_plugins/markdown-block.rb new file mode 100644 index 00000000..f9f1531b --- /dev/null +++ b/vnfmarket/src/main/webapp/vnfmarket/common/thirdparty/bootstrap/_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) |