Allow users to pass anchors to page links.
http://github.com/github/gollum/issues/\#issue/21
This commit is contained in:
+17
-1
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user