diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb index dd37e0da..8e4fdde5 100644 --- a/lib/gollum/markup.rb +++ b/lib/gollum/markup.rb @@ -441,13 +441,16 @@ module Gollum # Find a page from a given cname. If the page has an anchor (#) and has # no match, strip the anchor and try again. # - # cname - The String canonical page name. + # cname - The String canonical page name including path. # # Returns a Gollum::Page instance if a page is found, or an Array of # [Gollum::Page, String extra] if a page without the extra anchor data # is found. def find_page_from_name(cname) - if page = @wiki.page(cname) + slash = cname.rindex('/') + name = cname[slash+1..-1] + path = cname[0..slash] + if page = @wiki.paged(name, path) return page end if pos = cname.index('#')