From 8221bd632117a797a05de12135133b4fe8657e42 Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Tue, 20 Jul 2010 22:26:13 -0500 Subject: [PATCH] Fix file link with external path. --- lib/gollum/markup.rb | 4 +++- test/test_markup.rb | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb index 5229d8e0..097fd9c9 100644 --- a/lib/gollum/markup.rb +++ b/lib/gollum/markup.rb @@ -190,8 +190,10 @@ module Gollum nil end - if name && path + if name && path && file %{#{name}} + elsif name && path + %{#{name}} else nil end diff --git a/test/test_markup.rb b/test/test_markup.rb index 93c8b2c7..5316f02e 100644 --- a/test/test_markup.rb +++ b/test/test_markup.rb @@ -195,6 +195,15 @@ context "Markup" do assert_equal %{

a Alpha b

}, output end + test "file link with external path" do + index = @wiki.repo.index + index.add("greek/Bilbo-Baggins.md", "a [[Alpha|http://example.com/alpha.jpg]] b") + index.commit("Add alpha.jpg") + + page = @wiki.page("Bilbo Baggins") + assert_equal %{

a Alpha b

}, page.formatted_data + end + test "code blocks" do content = "a\n\n```ruby\nx = 1\n```\n\nb" output = "

a

\n\n
" +