diff options
author | Patrick Spek <p.spek@tyil.nl> | 2021-02-05 09:55:25 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2021-04-01 07:26:50 +0200 |
commit | c455896ae9e69e2498742ff795e7886dee1ffa23 (patch) | |
tree | 62a7353cbd1b14b4dd93b453f1f38cfe533c66ec /src/_plugins/html-markdown.rb | |
parent | 32acfbf6bf21d52e987d1b7599128f75b759ab28 (diff) |
Move source files into src
Diffstat (limited to 'src/_plugins/html-markdown.rb')
-rw-r--r-- | src/_plugins/html-markdown.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/_plugins/html-markdown.rb b/src/_plugins/html-markdown.rb new file mode 100644 index 0000000..7d60137 --- /dev/null +++ b/src/_plugins/html-markdown.rb @@ -0,0 +1,17 @@ +module Jekyll + class MarkdownBlock < Liquid::Block + def initialize(tag_name, text, tokens) + super + end + + require "redcarpet" + + def render(context) + content = super + + "#{Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(content)}" + end + end +end + +Liquid::Template.register_tag('markdown', Jekyll::MarkdownBlock) |