Merge branch 'master' into exp
This commit is contained in:
@@ -162,7 +162,7 @@ module Gollum
|
|||||||
name = parts[0].strip
|
name = parts[0].strip
|
||||||
path = if file = find_file(name)
|
path = if file = find_file(name)
|
||||||
::File.join @wiki.base_path, file.path
|
::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
|
name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -145,6 +145,17 @@ context "Markup" do
|
|||||||
end
|
end
|
||||||
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
|
test "image with absolute path" do
|
||||||
@wiki = Gollum::Wiki.new(@path, :base_path => '/wiki')
|
@wiki = Gollum::Wiki.new(@path, :base_path => '/wiki')
|
||||||
index = @wiki.repo.index
|
index = @wiki.repo.index
|
||||||
|
|||||||
Reference in New Issue
Block a user