Support octopress-hooks and octopress-date-format #1622
This commit is contained in:
parent
18784a4cb0
commit
73e540409c
11 changed files with 47 additions and 58 deletions
|
@ -1,10 +1,9 @@
|
|||
require './plugins/pygments_code'
|
||||
|
||||
module BacktickCodeBlock
|
||||
include HighlightCode
|
||||
AllOptions = /([^\s]+)\s+(.+?)\s+(https?:\/\/\S+|\/\S+)\s*(.+)?/i
|
||||
LangCaption = /([^\s]+)\s*(.+)?/i
|
||||
def render_code_block(input)
|
||||
def self.render_code_block(input)
|
||||
@options = nil
|
||||
@caption = nil
|
||||
@lang = nil
|
||||
|
@ -26,7 +25,7 @@ module BacktickCodeBlock
|
|||
str = str.gsub(/^( {4}|\t)/, '')
|
||||
end
|
||||
if @lang.nil? || @lang == 'plain'
|
||||
code = tableize_code(str.gsub('<','<').gsub('>','>'))
|
||||
code = HighlightCode::tableize_code(str.gsub('<','<').gsub('>','>'))
|
||||
"<figure class='code'>#{@caption}#{code}</figure>"
|
||||
else
|
||||
if @lang.include? "-raw"
|
||||
|
@ -34,7 +33,7 @@ module BacktickCodeBlock
|
|||
raw += str
|
||||
raw += "\n```\n"
|
||||
else
|
||||
code = highlight(str, @lang)
|
||||
code = HighlightCode::highlight(str, @lang)
|
||||
"<figure class='code'>#{@caption}#{code}</figure>"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue