diff --git a/snooty/parser.py b/snooty/parser.py index 2bc0d48d..f130a6fd 100644 --- a/snooty/parser.py +++ b/snooty/parser.py @@ -1349,7 +1349,7 @@ def _locate_text(text: str) -> int: return doc is_remote = root.startswith(("http://", "https://")) - if is_remote: # Remote mode (original mode): fetch from internet + if is_remote: # Remote mode (original mode): fetch from internet url = urllib.parse.urljoin(root, argument_text) try: response = util.HTTPCache.singleton().get(url) @@ -1359,11 +1359,13 @@ def _locate_text(text: str) -> int: CannotOpenFile(Path(argument_text), str(err), node.get_line()) ) return doc - else: # File mode: treat sharedinclude_root as a filesystem directory + else: # File mode: treat sharedinclude_root as a filesystem directory try: # sharedinclude_root should be a relative path from the # source directory of the project - file_path = self.project_config.source_path / Path(root) / argument_text + file_path = ( + self.project_config.source_path / Path(root) / argument_text + ) content = file_path.read_text(encoding="utf-8") except OSError as err: self.diagnostics.append(