|
@ -49,8 +49,8 @@ module Jekyll |
|
|
class CodeBlock < Liquid::Block |
|
|
class CodeBlock < Liquid::Block |
|
|
include HighlightCode |
|
|
include HighlightCode |
|
|
include TemplateWrapper |
|
|
include TemplateWrapper |
|
|
CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)\s+(.+)/i |
|
|
CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/\S+|\/\S+)\s*(.+)?/i |
|
|
CaptionUrl = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)/i |
|
|
CaptionUrl = /(\S[\S\s]*)\s+(https?:\/\/\S+|\/\S+)/i |
|
|
Caption = /(\S[\S\s]*)/ |
|
|
Caption = /(\S[\S\s]*)/ |
|
|
def initialize(tag_name, markup, tokens) |
|
|
def initialize(tag_name, markup, tokens) |
|
|
@title = nil |
|
|
@title = nil |
|
@ -63,10 +63,10 @@ module Jekyll |
|
|
end |
|
|
end |
|
|
if markup =~ CaptionUrlTitle |
|
|
if markup =~ CaptionUrlTitle |
|
|
@file = $1 |
|
|
@file = $1 |
|
|
@caption = "<figcaption><span>#{$1}</span><a href='#{$2 + $3}'>#{$4}</a></figcaption>" |
|
|
@caption = "<figcaption><span>#{$1}</span><a href='#{$2}'>#{$3}</a></figcaption>" |
|
|
elsif markup =~ CaptionUrl |
|
|
elsif markup =~ CaptionUrl |
|
|
@file = $1 |
|
|
@file = $1 |
|
|
@caption = "<figcaption><span>#{$1}</span><a href='#{$2 + $3}'>link</a></figcaption>" |
|
|
@caption = "<figcaption><span>#{$1}</span><a href='#{$2}'>link</a></figcaption>" |
|
|
elsif markup =~ Caption |
|
|
elsif markup =~ Caption |
|
|
@file = $1 |
|
|
@file = $1 |
|
|
@caption = "<figcaption><span>#{$1}</span></figcaption>\n" |
|
|
@caption = "<figcaption><span>#{$1}</span></figcaption>\n" |
|
|