diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-07-19 18:00:56 -0400 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-07-19 18:00:56 -0400 |
commit | 6f646e7290114721a1b4d6b49f25496ad8d7ca7e (patch) | |
tree | 7034d36e6497ec026c4ad202e69cf0bdb993315d /plugins/code_block.rb | |
parent | cc1cfa56b200a93532fb392d96d85426fcc91f38 (diff) | |
download | my_new_personal_website-6f646e7290114721a1b4d6b49f25496ad8d7ca7e.tar.xz my_new_personal_website-6f646e7290114721a1b4d6b49f25496ad8d7ca7e.zip |
added <div> wrappers to code blocks because rdiscount stupidly wraps <figure> tags with paragraphs. Grr.
Diffstat (limited to '')
-rw-r--r-- | plugins/code_block.rb | 10 |
1 files changed, 5 insertions, 5 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 |