Escape lisp-quoted wiki links.

This commit is contained in:
Tom Preston-Werner
2010-07-08 19:04:36 -07:00
parent 9e3a307aa8
commit 2c2bf68a3b
2 changed files with 30 additions and 4 deletions
+22
View File
@@ -182,6 +182,28 @@ context "Markup" do
assert_equal output, rendered
end
test "escaped wiki link" do
content = "a '[[Foo]], b"
output = "<p>a [[Foo]], b</p>"
compare(content, output)
end
test "quoted wiki link" do
content = "a '[[Foo]]', b"
output = "<p>a '<a class=\"internal absent\" href=\"Foo\">Foo</a>', b</p>"
compare(content, output)
end
def compare(content, output)
index = @wiki.repo.index
index.add("Bilbo-Baggins.md", content)
index.commit("Add alpha.jpg")
page = @wiki.page("Bilbo Baggins")
rendered = Gollum::Markup.new(page).render
assert_equal output, rendered
end
def relative_image(content, output)
index = @wiki.repo.index
index.add("greek/alpha.jpg", "hi")