From c18de558759dff2c77e6e0fc3ce2ad7a9f3fea99 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 26 Dec 2012 17:18:29 -0600 Subject: Titles in code plugins can have slashes in them. Closes #892 --- plugins/backtick_code_block.rb | 2 +- plugins/code_block.rb | 8 ++++---- source/images/icon-sdc231d6676.png | Bin 0 -> 1513 bytes 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 source/images/icon-sdc231d6676.png 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 = "
#{$1}#{$4}
" + @caption = "
#{$1}#{$3}
" elsif markup =~ CaptionUrl @file = $1 - @caption = "
#{$1}link
" + @caption = "
#{$1}link
" elsif markup =~ Caption @file = $1 @caption = "
#{$1}
\n" diff --git a/source/images/icon-sdc231d6676.png b/source/images/icon-sdc231d6676.png new file mode 100644 index 00000000..38ef928f Binary files /dev/null and b/source/images/icon-sdc231d6676.png differ -- cgit v1.2.1