Support octopress-hooks and octopress-date-format #1622

This commit is contained in:
Brandon Mathis 2014-08-12 10:55:23 -05:00
parent 18784a4cb0
commit 73e540409c
11 changed files with 47 additions and 58 deletions

View file

@ -47,8 +47,6 @@ require './plugins/raw'
module Jekyll
class CodeBlock < Liquid::Block
include HighlightCode
include TemplateWrapper
CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/\S+|\/\S+)\s*(.+)?/i
Caption = /(\S[\S\s]*)/
def initialize(tag_name, markup, tokens)
@ -79,11 +77,11 @@ module Jekyll
source = "<figure class='code'>"
source += @caption if @caption
if @filetype
source += "#{highlight(code, @filetype)}</figure>"
source += "#{HighlightCode::highlight(code, @filetype)}</figure>"
else
source += "#{tableize_code(code.lstrip.rstrip.gsub(/</,'&lt;'))}</figure>"
source += "#{HighlightCode::tableize_code(code.lstrip.rstrip.gsub(/</,'&lt;'))}</figure>"
end
source = safe_wrap(source)
source = TemplateWrapper::safe_wrap(source)
source = context['pygments_prefix'] + source if context['pygments_prefix']
source = source + context['pygments_suffix'] if context['pygments_suffix']
source