diff --git a/plugins/code_block.rb b/plugins/code_block.rb
index 62c551a..660f73d 100644
--- a/plugins/code_block.rb
+++ b/plugins/code_block.rb
@@ -50,7 +50,6 @@ module Jekyll
include HighlightCode
include TemplateWrapper
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 +62,7 @@ module Jekyll
end
if markup =~ CaptionUrlTitle
@file = $1
- @caption = "#{$1}#{$3}"
- elsif markup =~ CaptionUrl
- @file = $1
- @caption = "#{$1}link"
+ @caption = "#{$1}#{$3 || 'link'}"
elsif markup =~ Caption
@file = $1
@caption = "#{$1}\n"