From c455896ae9e69e2498742ff795e7886dee1ffa23 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Fri, 5 Feb 2021 09:55:25 +0100 Subject: Move source files into src --- src/_plugins/html-markdown.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/_plugins/html-markdown.rb (limited to 'src/_plugins/html-markdown.rb') 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) -- cgit v1.1