diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb index 0067d367..dbb6f4b8 100644 --- a/lib/gollum/markup.rb +++ b/lib/gollum/markup.rb @@ -179,6 +179,8 @@ module Gollum # if it is not. def process_image_tag(tag) parts = tag.split('|') + return if parts.size.zero? + name = parts[0].strip path = if file = find_file(name) ::File.join @wiki.base_path, file.path @@ -267,6 +269,8 @@ module Gollum # if it is not. def process_file_link_tag(tag) parts = tag.split('|') + return if parts.size.zero? + name = parts[0].strip path = parts[1] && parts[1].strip path = if path && file = find_file(path) diff --git a/test/test_markup.rb b/test/test_markup.rb index 9c52f4ac..4f759ca3 100644 --- a/test/test_markup.rb +++ b/test/test_markup.rb @@ -446,6 +446,18 @@ context "Markup" do compare(content, output, 'org') end + test "short double links" do + content = "a [[b]] c" + output = %(

a b c

) + compare(content, output, 'org') + end + + test "double linked pipe" do + content = "a [[|]] b" + output = %(

a b

) + compare(content, output, 'org') + end + ######################################################################### # # TeX