Merge branch 'master' into exp

This commit is contained in:
rick
2010-10-12 10:22:56 -07:00
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ module Gollum
name = parts[0].strip
path = if file = find_file(name)
::File.join @wiki.base_path, file.path
elsif name =~ /^https?:\/\/.+(jpg|png|gif|svg|bmp)$/
elsif name =~ /^https?:\/\/.+(jpg|png|gif|svg|bmp)$/i
name
end
+11
View File
@@ -145,6 +145,17 @@ context "Markup" do
end
end
test "image with extension in caps with http url" do
['http', 'https'].each do |scheme|
name = "Bilbo Baggins #{scheme}"
@wiki.write_page(name, :markdown, "a [[#{scheme}://example.com/bilbo.JPG]] b", commit_details)
page = @wiki.page(name)
output = page.formatted_data
assert_equal %{<p>a <img src="#{scheme}://example.com/bilbo.JPG" /> b</p>}, output
end
end
test "image with absolute path" do
@wiki = Gollum::Wiki.new(@path, :base_path => '/wiki')
index = @wiki.repo.index