Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes a bug when 'edit_url' is not defined in the config
  • Loading branch information
funkyfuture committed Sep 7, 2017
1 parent d346c66 commit 67b9882
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mkdocs/nav.py
Expand Up @@ -258,13 +258,13 @@ def _set_canonical_url(self, base):
self.canonical_url = utils.urljoin(base, self.abs_url.lstrip('/'))

def _set_edit_url(self, repo_url, edit_uri):
if not repo_url.endswith('/'):
# Skip when using query or fragment in edit_uri
if not edit_uri.startswith('?') and not edit_uri.startswith('#'):
repo_url += '/'
if not edit_uri:
self.edit_url = repo_url
else:
if not repo_url.endswith('/'):
# Skip when using query or fragment in edit_uri
if not edit_uri.startswith('?') and not edit_uri.startswith('#'):
repo_url += '/'
# Normalize URL from Windows path '\\' -> '/'
input_path_url = self.input_path.replace('\\', '/')
if not edit_uri.endswith('/'):
Expand Down

0 comments on commit 67b9882

Please sign in to comment.