fix markup on framed absolute image urls

This commit is contained in:
rick
2010-08-16 15:49:47 -07:00
parent c7e172f5ca
commit dd30a7bdc2
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ module Gollum
classes << 'frame' if opts['frame']
%{<span class="#{classes.join(' ')}">} +
%{<span>} +
%{<img src="/#{file.path}" #{attr_string}/>} +
%{<img src="#{path}" #{attr_string}/>} +
(alt ? %{<span>#{alt}</span>} : '') +
%{</span>} +
%{</span>}
+6
View File
@@ -205,6 +205,12 @@ context "Markup" do
relative_image(content, output)
end
test "absolute image with frame" do
content = "a\n\n[[http://example.com/bilbo.jpg|frame]]\n\nb"
output = "<p>a</p>\n\n<p><span class=\"frame\"><span><img src=\"http://example.com/bilbo.jpg\" /></span></span></p>\n\n<p>b</p>"
relative_image(content, output)
end
test "image with frame and alt" do
content = "a\n\n[[alpha.jpg|frame|alt=Alpha]]\n\nb"
output = "<p>a</p>\n\n<p><span class=\"frame\"><span><img src=\"/greek/alpha.jpg\" alt=\"Alpha\" /><span>Alpha</span></span></span></p>\n\n<p>b</p>"