aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2012-12-26 17:18:29 -0600
committerBrandon Mathis <brandon@imathis.com>2012-12-26 17:19:50 -0600
commitc18de558759dff2c77e6e0fc3ce2ad7a9f3fea99 (patch)
tree13c76150e66ec5ec553e109a9d0f6be0f15d060a
parent48d3e75ff5d3468369ca8104379b870f7cf600b1 (diff)
downloadmy_new_personal_website-c18de558759dff2c77e6e0fc3ce2ad7a9f3fea99.tar.xz
my_new_personal_website-c18de558759dff2c77e6e0fc3ce2ad7a9f3fea99.zip
Titles in code plugins can have slashes in them. Closes #892
-rw-r--r--plugins/backtick_code_block.rb2
-rw-r--r--plugins/code_block.rb8
-rw-r--r--source/images/icon-sdc231d6676.pngbin0 -> 1513 bytes
3 files changed, 5 insertions, 5 deletions
diff --git a/plugins/backtick_code_block.rb b/plugins/backtick_code_block.rb
index 0e7cee41..8e2c1141 100644
--- a/plugins/backtick_code_block.rb
+++ b/plugins/backtick_code_block.rb
@@ -2,7 +2,7 @@ require './plugins/pygments_code'
module BacktickCodeBlock
include HighlightCode
- AllOptions = /([^\s]+)\s+(.+?)(https?:\/\/\S+|\/\S+)\s*(.+)?/i
+ AllOptions = /([^\s]+)\s+(.+?)\s+(https?:\/\/\S+|\/\S+)\s*(.+)?/i
LangCaption = /([^\s]+)\s*(.+)?/i
def render_code_block(input)
@options = nil
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"
diff --git a/source/images/icon-sdc231d6676.png b/source/images/icon-sdc231d6676.png
new file mode 100644
index 00000000..38ef928f
--- /dev/null
+++ b/source/images/icon-sdc231d6676.png
Binary files differ