diff options
author | Brandon Mathis <brandon@imathis.com> | 2014-08-12 10:55:23 -0500 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2014-08-12 10:56:45 -0500 |
commit | 73e540409ceb8bc18048b6a96a4b815fc303ea28 (patch) | |
tree | ca3ae0e5cca03c7f0c8012a3ed4fbbf36b11ab9d /plugins/backtick_code_block.rb | |
parent | 18784a4cb04ed658268a5a4ba9bdf399e0c898ff (diff) | |
download | my_new_personal_website-73e540409ceb8bc18048b6a96a4b815fc303ea28.tar.xz my_new_personal_website-73e540409ceb8bc18048b6a96a4b815fc303ea28.zip |
Support octopress-hooks and octopress-date-format #1622
Diffstat (limited to 'plugins/backtick_code_block.rb')
-rw-r--r-- | plugins/backtick_code_block.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/backtick_code_block.rb b/plugins/backtick_code_block.rb index 8e2c1141..ae4a0472 100644 --- a/plugins/backtick_code_block.rb +++ b/plugins/backtick_code_block.rb @@ -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 |