Skip to content

Commit

Permalink
Force complete path sections when searching for pages
Browse files Browse the repository at this point in the history
(closes #12673)
  • Loading branch information
aeslaughter committed Jan 11, 2019
1 parent 1abf649 commit 53b08ff
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions python/MooseDocs/base/translators.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ def findPages(self, arg):
nodes = self.findPages('name')
nodes = self.findPages(lambda p: p.name == 'foo')
The string version is equivalent to:
nodes = self.findPages(lambda p: p.local.endswith(arg))
Inputs:
name[str|unicode|lambda]: The partial name to search against or the function to use
to test for matches.
Expand All @@ -171,7 +168,7 @@ def findPages(self, arg):
if isinstance(arg, (str, unicode)):
items = self.__page_cache.get(arg, None)
if items is None:
func = lambda p: p.local.endswith(arg)
func = lambda p: (p.local == arg) or p.local.endswith(os.sep + arg.lstrip(os.sep))
items = [page for page in self.__content if func(page)]
self.__page_cache[arg] = items

Expand Down

0 comments on commit 53b08ff

Please sign in to comment.