Preserve orgmode-style double links.

This commit is contained in:
Tom Preston-Werner
2010-07-09 16:09:24 -07:00
parent e46a845ef5
commit 970bb92c7a
2 changed files with 11 additions and 3 deletions
+2
View File
@@ -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
+9 -3
View File
@@ -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 = "<p class=\"title\">a <a href=\"http://google.com\">Google</a> b</p>"
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