From 5e445a7e4ebbd7a0e64b945456f72c968663ac89 Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Thu, 16 May 2024 12:06:30 -0700 Subject: [PATCH] docs: dont rewrite ipynb links that have double slash (#21775) --- docs/scripts/notebook_convert.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/scripts/notebook_convert.py b/docs/scripts/notebook_convert.py index af3a0e576d..76ccaf4500 100644 --- a/docs/scripts/notebook_convert.py +++ b/docs/scripts/notebook_convert.py @@ -27,7 +27,9 @@ class EscapePreprocessor(Preprocessor): ) # rewrite .ipynb links to .md cell.source = re.sub( - r"\[([^\]]*)\]\(([^)]*).ipynb\)", r"[\1](\2.md)", cell.source + r"\[([^\]]*)\]\((?![^\)]*//)([^)]*)\.ipynb\)", + r"[\1](\2.md)", + cell.source, ) return cell, resources