From 92630aaaac19343088ced5e1f245484cdfcb3f11 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Mon, 16 Sep 2024 13:38:59 +0200 Subject: [PATCH] Correctly detect ipynb files when replacing links --- nbsite/gallery/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbsite/gallery/gen.py b/nbsite/gallery/gen.py index 49dbbe4..382795a 100644 --- a/nbsite/gallery/gen.py +++ b/nbsite/gallery/gen.py @@ -284,7 +284,7 @@ def replace_link(match): # Do not change absolute links and non-ipynb links parsed_url = urlparse(link) - if parsed_url.scheme != '' or parsed_url.netloc != '' or link.lower().endswith('.ipynb'): + if parsed_url.scheme != '' or parsed_url.netloc != '' or not link.lower().endswith('.ipynb'): return match.group(0) md_dir = os.path.dirname(os.path.abspath(filepath))