Allow users to pass anchors to page links.

http://github.com/github/gollum/issues/\#issue/21
This commit is contained in:
rick
2010-09-30 15:32:02 -07:00
parent 7924db8e01
commit 05a7b4c06c
2 changed files with 34 additions and 8 deletions
+17 -1
View File
@@ -89,12 +89,28 @@ context "Markup" do
page = @wiki.page(name)
output = page.formatted_data
assert_match /class="internal present"/, output
assert_match /class="internal present"/, output
assert_match /href="\/wiki\/Bilbo-Baggins-\d"/, output
assert_match /\>Bilbo Baggins \d\</, output
end
end
test "page link with included #" do
@wiki.write_page("Precious #1", :markdown, "a [[Precious #1]] b", commit_details)
page = @wiki.page('Precious #1')
output = page.formatted_data
assert_match /class="internal present"/, output
assert_match /href="\/Precious-%231"/, output
end
test "page link with extra #" do
@wiki.write_page("Potato", :markdown, "a [[Potato#1]] b", commit_details)
page = @wiki.page('Potato')
output = page.formatted_data
assert_match /class="internal present"/, output
assert_match /href="\/Potato#1"/, output
end
test "external page link" do
@wiki.write_page("Bilbo Baggins", :markdown, "a [[http://example.com]] b", commit_details)