From d8c54fa51a5e4070590eaf97b4fb255deaabefb9 Mon Sep 17 00:00:00 2001 From: Chris Van Pelt Date: Sun, 23 Nov 2008 14:55:15 -0800 Subject: [PATCH] Custom liquid tag for creating code blocks --- lib/jekyll/blocks.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/jekyll/blocks.rb diff --git a/lib/jekyll/blocks.rb b/lib/jekyll/blocks.rb new file mode 100644 index 00000000..70ae6b02 --- /dev/null +++ b/lib/jekyll/blocks.rb @@ -0,0 +1,15 @@ +module Jekyll + class Highlight < Liquid::Block + include Liquid::StandardFilters + + def initialize(tag_name, lang, tokens) + super + @lang = lang.strip + end + + def render(context) + "
#{escape(super)}
" + end + end +end +Liquid::Template.register_tag('highlight', Jekyll::Highlight) \ No newline at end of file