diff options
Diffstat (limited to 'plugins/code_block.rb')
-rw-r--r-- | plugins/code_block.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/code_block.rb b/plugins/code_block.rb index 4cf2817b..af64e031 100644 --- a/plugins/code_block.rb +++ b/plugins/code_block.rb @@ -41,9 +41,12 @@ # <pre><code><sarcasm> Ooooh, sarcasm... How original!</sarcasm></code></pre> # </figure> # +require './plugins/pygments_code' + module Jekyll class CodeBlock < Liquid::Block + include HighlightCode CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)\s+(.+)/i CaptionUrl = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)/i Caption = /(\S[\S\s]*)/ @@ -75,7 +78,7 @@ module Jekyll if @filetype @filetype = 'objc' if @filetype == 'm' @filetype = 'perl' if @filetype == 'pl' - source += "{% highlight #{@filetype} %}\n" + code + "\n{% endhighlight %}</figure></div>" + source += " #{highlight(code, @filetype)}</figure></div>" else source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'<') + "</code></pre></figure></div>" end |