aboutsummaryrefslogtreecommitdiff
path: root/plugins/code_block.rb
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/code_block.rb')
-rw-r--r--plugins/code_block.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/code_block.rb b/plugins/code_block.rb
index 44e34945..62c551a4 100644
--- a/plugins/code_block.rb
+++ b/plugins/code_block.rb
@@ -49,8 +49,8 @@ module Jekyll
class CodeBlock < Liquid::Block
include HighlightCode
include TemplateWrapper
- CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)\s+(.+)/i
- CaptionUrl = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)/i
+ CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/\S+|\/\S+)\s*(.+)?/i
+ CaptionUrl = /(\S[\S\s]*)\s+(https?:\/\/\S+|\/\S+)/i
Caption = /(\S[\S\s]*)/
def initialize(tag_name, markup, tokens)
@title = nil
@@ -63,10 +63,10 @@ module Jekyll
end
if markup =~ CaptionUrlTitle
@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
@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
@file = $1
@caption = "<figcaption><span>#{$1}</span></figcaption>\n"