mirror of
https://github.com/moparisthebest/www.moparscape.org
synced 2024-12-25 00:48:49 -05:00
Titles in code plugins can have slashes in them. Closes #892
This commit is contained in:
parent
48d3e75ff5
commit
c18de55875
@ -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
|
||||
|
@ -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"
|
||||
|
BIN
source/images/icon-sdc231d6676.png
Normal file
BIN
source/images/icon-sdc231d6676.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in New Issue
Block a user