diff options
Diffstat (limited to 'plugins/include_code.rb')
-rw-r--r-- | plugins/include_code.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/include_code.rb b/plugins/include_code.rb index 70d5f138..80951cb5 100644 --- a/plugins/include_code.rb +++ b/plugins/include_code.rb @@ -21,12 +21,14 @@ # require './plugins/pygments_code' +require './plugins/raw' require 'pathname' module Jekyll class IncludeCodeTag < Liquid::Tag include HighlightCode + include TemplateWrapper def initialize(tag_name, markup, tokens) @title = nil @file = nil @@ -59,8 +61,9 @@ module Jekyll @filetype = file.extname.sub('.','') if @filetype.nil? title = @title ? "#{@title} (#{file.basename})" : file.basename url = "/#{code_dir}/#{@file}" - source = "<div><figure role=code><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n" - source += " #{highlight(code, @filetype)}</figure></div>" + source = "<figure role=code><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n" + source += " #{highlight(code, @filetype)}</figure>" + safe_wrap(source) end end end |