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
This commit is contained in:
parent
59521e3db8
commit
ef4a42f977
3 changed files with 21 additions and 13 deletions
|
@ -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(/</,'<') + "</code></pre></figure></div>"
|
||||
source += "#{tableize_code(code.lstrip.rstrip.gsub(/</,'<'))}</figure></div>"
|
||||
end
|
||||
source = source + context['pygments_suffix'] if context['pygments_suffix']
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue