From 01fa4770cbeb4b2a0cb9090abb74681be2a8948f Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Thu, 23 Aug 2012 12:16:40 -0600 Subject: [PATCH] Fix page lookup. #473 --- lib/gollum/markup.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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('#')