diff --git a/vendor/plugins/maruku/lib/maruku/input/parse_block.rb b/vendor/plugins/maruku/lib/maruku/input/parse_block.rb index 6907f13c..88ebf573 100644 --- a/vendor/plugins/maruku/lib/maruku/input/parse_block.rb +++ b/vendor/plugins/maruku/lib/maruku/input/parse_block.rb @@ -482,12 +482,12 @@ module MaRuKu; module In; module Markdown; module BlockLevelParser return end - id = match[1]; url = match[2]; title = match[3]; + id = match[1]; url = match[2]; title = match[3] || match[4] || match[5]; id = sanitize_ref_id(id) hash = self.refs[id] = {:url=>url,:title=>title} - stuff=match[4] + stuff=match[6] if stuff stuff.split.each do |couple| diff --git a/vendor/plugins/maruku/lib/maruku/input/type_detection.rb b/vendor/plugins/maruku/lib/maruku/input/type_detection.rb index e52563a6..0769cff8 100644 --- a/vendor/plugins/maruku/lib/maruku/input/type_detection.rb +++ b/vendor/plugins/maruku/lib/maruku/input/type_detection.rb @@ -120,11 +120,9 @@ module MaRuKu; module Strings [ ]* ([^>\s]+)>? # url = $2 [ ]* - (?:# Titles are delimited by "quotes" or (parens). - ["('] - (.+?) # title = $3 - [")'] # Matching ) or " - \s*(.+)? # stuff = $4 + (?: # Titles are delimited by "quotes" or (parens). + (?:(?:"([^"]+)")|(?:'([^']+)')|(?:\(([^\(\)]+)\))) # title = $3, $4, or $5 + \s*(.+)? # stuff = $6 )? # title is optional }x diff --git a/vendor/plugins/maruku/spec/block_docs/links.md b/vendor/plugins/maruku/spec/block_docs/links.md index 056d657d..0b6ecd5c 100644 --- a/vendor/plugins/maruku/spec/block_docs/links.md +++ b/vendor/plugins/maruku/spec/block_docs/links.md @@ -27,6 +27,8 @@ If all else fails, ask [Google](http://www.google.com) And now [reference-style link ID with spaces] [Google Images] +And now [reference-style link ID (without spaces)][Google Search] + [google]: http://www.google.com [google2]: http://www.google.com 'Single quotes' @@ -36,7 +38,7 @@ And now [reference-style link ID with spaces] [Google Images] [google4]: http://www.google.com (Parenthesis) [Google Search]: - http://www.google.com "Google search" + http://www.google.com 'Google search' [Google Images]: http://images.google.com (Google images) @@ -73,6 +75,10 @@ md_el(:document,[ "And now ", md_link(["reference-style link ID with spaces"],"google_images") ]), + md_par([ + "And now ", + md_link(["reference-style link ID (without spaces)"], "google_search") + ]), md_ref_def("google", "http://www.google.com", {:title=>nil}), md_ref_def("google2", "http://www.google.com", {:title=>"Single quotes"}), md_ref_def("google3", "http://www.google.com", {:title=>"Double quotes"}), @@ -102,6 +108,8 @@ md_el(:document,[
If all else fails, ask Google
+ + *** Output of to_latex *** Search on \href{http://www.google.com}{Google} @@ -124,6 +132,8 @@ Search on \href{http://www.gogole.com}{http\char58\char47\char47www\char46gogole If all else fails, ask \href{http://www.google.com}{Google} And now \href{http://images.google.com}{reference-style link ID with spaces} + +And now \href{http://www.google.com}{reference-style link ID (without spaces)} *** Output of to_md *** Search on Google @@ -148,5 +158,8 @@ If all else fails, ask Google And now reference-style link ID with spaces + +And now +reference-style link ID (without spaces) *** Output of to_s *** -Search on GoogleSearch on GoogleSearch on GoogleSearch on GoogleSearch on Google imagesInline: Google imagesInline with title: Google imagesInline with title: Google imagesSearch on or or ask or you might ask bill@google.com.If all else fails, ask GoogleAnd now reference-style link ID with spaces +Search on GoogleSearch on GoogleSearch on GoogleSearch on GoogleSearch on Google imagesInline: Google imagesInline with title: Google imagesInline with title: Google imagesSearch on or or ask or you might ask bill@google.com.If all else fails, ask GoogleAnd now reference-style link ID with spacesAnd now reference-style link ID (without spaces)