diff --git a/menu_generator/menu.py b/menu_generator/menu.py index 276d76e..f20d0d3 100755 --- a/menu_generator/menu.py +++ b/menu_generator/menu.py @@ -91,14 +91,14 @@ def _is_selected(self, item_dict): If related URLS are given, it also returns true if one of the related URLS is part of path. """ url = self._get_url(item_dict) - if self._is_root(item_dict) and url in self.path: + if self._is_root(item_dict) and self.path.startswith(url): return True elif url == self.path: return True else: # Go through all related URLs and test for related_url in self._get_related_urls(item_dict): - if related_url in self.path: + if self.path.startswith(related_url): return True return False