aboutsummaryrefslogtreecommitdiff
path: root/plugins/code_block.rb
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2011-08-16 02:40:47 -0400
committerBrandon Mathis <brandon@imathis.com>2011-08-16 02:41:28 -0400
commitef4a42f9774ca36c8cf9921aadda93572c26fba6 (patch)
treea1376cabeea8613f1a0ff4200d5f5a67c0e903d9 /plugins/code_block.rb
parent59521e3db81b36f8abe8c61802f5acf74d15ebfe (diff)
downloadmy_new_personal_website-ef4a42f9774ca36c8cf9921aadda93572c26fba6.tar.xz
my_new_personal_website-ef4a42f9774ca36c8cf9921aadda93572c26fba6.zip
Codeblock regex improved to better detect extensions fixes #96, added support for tableizing non highlighted code blocks from liquid codeblock tag and backtick code blocks
Diffstat (limited to 'plugins/code_block.rb')
-rw-r--r--plugins/code_block.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/code_block.rb b/plugins/code_block.rb
index ff242aab..55267a36 100644
--- a/plugins/code_block.rb
+++ b/plugins/code_block.rb
@@ -64,7 +64,7 @@ module Jekyll
@file = $1
@caption = "<figcaption><span>#{$1}</span></figcaption>\n"
end
- if @file =~ /\S[\S\s]*\.(\w+)/
+ if @file =~ /\S[\S\s]*\w+\.(\w+)/
@filetype = $1
end
super
@@ -82,7 +82,7 @@ module Jekyll
@filetype = 'yaml' if @filetype == 'yml'
source += " #{highlight(code, @filetype)}</figure></div>"
else
- source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'&lt;') + "</code></pre></figure></div>"
+ source += "#{tableize_code(code.lstrip.rstrip.gsub(/</,'&lt;'))}</figure></div>"
end
source = source + context['pygments_suffix'] if context['pygments_suffix']
end