summaryrefslogtreecommitdiff
path: root/src/_plugins/html-markdown.rb
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2021-02-05 09:55:25 +0100
committerPatrick Spek <p.spek@tyil.nl>2021-02-05 09:55:25 +0100
commit70a2c42a5eef1dab2b7ab75e3c7f6ffc8c8c1959 (patch)
treec30a3e1d52e7a92fe3866f9833aa77ac4092eef4 /src/_plugins/html-markdown.rb
parent1d60b596b53202c0814663ed53b4279b40e05154 (diff)
Move source files into src
Diffstat (limited to 'src/_plugins/html-markdown.rb')
-rw-r--r--src/_plugins/html-markdown.rb17
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)