Skip to content

The agent engineering platform.

docs: dont rewrite ipynb links that have double slash (#21775)

Erick Friis5e445a7e4ebb
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