From c18de558759dff2c77e6e0fc3ce2ad7a9f3fea99 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 26 Dec 2012 17:18:29 -0600 Subject: [PATCH] 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 0e7cee4..8e2c114 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 44e3494..62c551a 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 0000000000000000000000000000000000000000..38ef928f78e5684b25350ca827535045008ae8bc GIT binary patch literal 1513 zcmeAS@N?(olHy`uVBq!ia0vp^3P7B|!3-q5|1_*(U|?Jx;1l8sKxN$%wN(#wXC5}*@!D+9 zTk|#7t+zk5U2xQQ-{{G!rwD(YGW#+Ej&fl;vu$(cF%6^+y8FI};E-Ns#qkDWYo z{?hG-PdEaktaqH|f zdmrIInd9~E@9o|FTK?ab2nW_V9x^mv~(qjKcr)eRPsa~25j_%85TTK>JN{N7jj>)&h(E_k%>K3zS(=6Ch}_wT>&7JfKo z{*U+u#+eKev!*df7){GfaEK~-Z$D+OcF+>Xi3hyh9VfNL9+?nRBT&OI^WP3$4h7zH zVbueVg^W`|dK?cid$(?Ne8Oaq;^mn1e}k0%nw_FXoa_rKJtoNo&RSv9zxO@EuAm93 zEON6&9TrVse|aK2N{}UNQOZH5Gb*!O4+z}&ogl*4Taa@?v~g)-C+~$xk=;3mI;P*f z;xkjQtt`hpFe1I8m?uN0Q91me%Ddm$9JwcB15ek=1$9cS*Yeh5{A(BUFgeus+i9Uy zpLX)tY_L5fn#%Ahdwb-rpsCAZ%61+)yJM~XG*O>bN3(w&ihFtZM&CiBGZxDWh0@nl zu5NrWrMSP&@W@mRAHxR!^6)pmkIz4`XX~wFK?dek>wRs1#-y81x^Rlg$z^0|L! z3zs>S{GIEzhoSNH8!@p~X=~5lEz|ejQjwm~a+AAk<-o0aO1=5;b${ppZ=VluPg zY_H9XSHk9dtx_+@xQ|9)->W9Hg=YOa1%$iklFRm&dC%MNYuny~ZowCf%(J64!7 zTxH($%k&1*Z+kw)1;K6?x7B5@FTcmt-Y|Q=@uvxSFK$e0J|~=cdRgSmJFi~&+|+b? zKFip1nfSFdg_QG2mOH8s6n}p3z-9MgF1Hhsd7pC>-ds<2`*Wk?lh&!`kO+yj#~v; zI5!D=Ykz+8K*#hKU&O;UOkey!c=P$U)i?TY3N7L|XLrVa>Q2L+vrp~k`1tWm`Jq&m z6QU&9cgV*jXi8?c+_8#!L+%3iEw2~;W;PGpeo|A|?Z;%vrEBLht(m*v!ef&({u!%n u7{u*9t-1V6MZV(x+n96TR{xyOyq_^Wg&}c