aboutsummaryrefslogtreecommitdiff
path: root/plugins/backtick_code_block.rb
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugins/backtick_code_block.rb7
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('<','&lt;').gsub('>','&gt;'))
+ code = HighlightCode::tableize_code(str.gsub('<','&lt;').gsub('>','&gt;'))
"<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