Permalink
Browse files

Merge pull request #12680 from aeslaughter/autolink-12673

Force complete path sections when searching for pages
  • Loading branch information...
aeslaughter committed Jan 11, 2019
2 parents f83d410 + 53b08ff commit 80c5a7cd1bb767b10cc46cd34cfedb0326f489f1
Showing with 1 addition and 4 deletions.
  1. +1 −4 python/MooseDocs/base/translators.py
@@ -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.
@@ -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

0 comments on commit 80c5a7c

Please sign in to comment.