File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,6 +241,9 @@ def _fix_edit_uri(self, edit_uri: str) -> str:
241241 # Mkdocs by default sets the edit_uri to 'edit/master/docs/' when the repo_url is GitHub and
242242 # 'src/default/docs/' when it's Bitbucket. We don't want docs to be in the edit_uri since
243243 # documentation isn't always in the docs directory for this plugin.
244+
245+ if not edit_uri :
246+ return ""
244247 edit_uri_parts = edit_uri .strip ("/" ).split ("/" )
245248 parts = len (edit_uri_parts )
246249 if parts > 1 and edit_uri_parts [1 ] == "master" and self .branch != "master" :
Original file line number Diff line number Diff line change @@ -280,6 +280,17 @@ def test_parse_repo_url(self):
280280 f"{ base_url } ?docs_dir=fldr/docs/*?config=multirepo.yml"
281281 )
282282
283+ def test_edit_uri_none (self ):
284+ repo = structure .DocsRepo (
285+ name = "test-repo" ,
286+ url = "https://github.com/jdoiro3/mkdocs-multirepo-demoRepo1" ,
287+ temp_dir = pathlib .Path ("." ),
288+ branch = "main" ,
289+ edit_uri = None
290+ )
291+
292+ self .assertEqual (repo .edit_uri , "" )
293+
283294 async def test_sparse_clone (self ):
284295 async with tempfile .TemporaryDirectory () as temp_dir :
285296 temp_dir_path = pathlib .Path (temp_dir )
You can’t perform that action at this time.
0 commit comments