diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb index 63529de5..134b2fe5 100644 --- a/lib/gollum/markup.rb +++ b/lib/gollum/markup.rb @@ -47,6 +47,8 @@ module Gollum data.gsub(/(.?)\[\[(.+?)\]\](.?)/m) do if $1 == "'" && $3 != "'" "[[#{$2}]]#{$3}" + elsif $2.include?('][') + $& else id = Digest::SHA1.hexdigest($2) @tagmap[id] = $2 diff --git a/test/test_markup.rb b/test/test_markup.rb index d14a5d9a..5cf35269 100644 --- a/test/test_markup.rb +++ b/test/test_markup.rb @@ -194,10 +194,16 @@ context "Markup" do compare(content, output) end - def compare(content, output) + test "org mode style double links" do + content = "a [[http://google.com][Google]] b" + output = "

a Google b

" + compare(content, output, 'org') + end + + def compare(content, output, ext = "md") index = @wiki.repo.index - index.add("Bilbo-Baggins.md", content) - index.commit("Add alpha.jpg") + index.add("Bilbo-Baggins.#{ext}", content) + index.commit("Add baggins") page = @wiki.page("Bilbo Baggins") rendered = Gollum::Markup.new(page).render