diff options
-rw-r--r-- | plugins/code_block.rb | 10 | ||||
-rw-r--r-- | plugins/include_code.rb | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/plugins/code_block.rb b/plugins/code_block.rb index 00762d8a..d204e1bd 100644 --- a/plugins/code_block.rb +++ b/plugins/code_block.rb @@ -45,10 +45,10 @@ module Jekyll @highlight = true if markup =~ CaptionUrlTitle @file = $1 - @caption = "<figcaption><span>#{$1}</span><a href='#{$2 + $3}'>#{$4}</a</figcaption>" + @caption = "<figcaption><span>#{$1}</span><a href='#{$2 + $3}'>#{$4}</a></figcaption>" elsif markup =~ CaptionUrl @file = $1 - @caption = "<figcaption><span>#{$1}</span><a href='#{$2 + $3}'>link</a</figcaption>" + @caption = "<figcaption><span>#{$1}</span><a href='#{$2 + $3}'>link</a></figcaption>" elsif markup =~ Caption @file = $1 @caption = "<figcaption><span>#{$1}</span></figcaption>\n" @@ -62,12 +62,12 @@ module Jekyll def render(context) output = super code = super.join - source = "<figure role=code>\n" + source = "<div><figure role=code>" source += @caption if @caption if @filetype - source += "{% highlight #{@filetype} %}\n" + code + "\n{% endhighlight %}\n</figure>" + source += "{% highlight #{@filetype} %}\n" + code + "\n{% endhighlight %}</figure></div>" else - source += "<pre><code>" + code.gsub!(/</,'<') + "</code></pre>\n</figure>" + source += "<pre><code>" + code.gsub!(/</,'<') + "</code></pre></figure></div>" end partial = Liquid::Template.parse(source) context.stack do diff --git a/plugins/include_code.rb b/plugins/include_code.rb index b063f14f..72a74ac7 100644 --- a/plugins/include_code.rb +++ b/plugins/include_code.rb @@ -40,8 +40,8 @@ module Jekyll code = file.read file_type = file.extname url = "#{context.registers[:site].config['url']}/#{code_dir}/#{@file}" - source = "<figure role=code><figcaption><span>#{file.basename}</span> <a href='#{url}'>download</a></figcaption>\n" - source += "{% highlight #{file_type} %}\n" + code + "\n{% endhighlight %}</figure>" + source = "<div><figure role=code><figcaption><span>#{file.basename}</span> <a href='#{url}'>download</a></figcaption>\n" + source += "{% highlight #{file_type} %}\n" + code + "\n{% endhighlight %}</figure></div>" partial = Liquid::Template.parse(source) context.stack do partial.render(context) |