fix bug where relative images in previews did not render

This commit is contained in:
rick
2011-01-27 16:34:29 -08:00
parent f708dc7002
commit 732e8a9361
3 changed files with 27 additions and 6 deletions
+2 -2
View File
@@ -333,9 +333,9 @@ module Gollum
# path - The String directory path of the page file.
#
# Returns the populated Gollum::Page.
def populate(blob, path)
def populate(blob, path=nil)
@blob = blob
@path = (path + '/' + blob.name)[1..-1]
@path = "#{path}/#{blob.name}"[1..-1]
self
end
+4 -4
View File
@@ -168,10 +168,10 @@ module Gollum
def preview_page(name, data, format)
page = @page_class.new(self)
ext = @page_class.format_to_ext(format.to_sym)
path = @page_class.cname(name) + '.' + ext
blob = OpenStruct.new(:name => path, :data => data)
page.populate(blob, path)
page.version = @access.commit('HEAD')
name = @page_class.cname(name) + '.' + ext
blob = OpenStruct.new(:name => name, :data => data)
page.populate(blob)
page.version = @access.commit('master')
page
end