Skip to content

The agent engineering platform.

docs: resolve local links script escape (#21840)

Erick Friiscdc8e2d0c201
diff --git a/docs/scripts/copy_templates.py b/docs/scripts/copy_templates.py
index 403a54693d..015c01611e 100644
--- a/docs/scripts/copy_templates.py
+++ b/docs/scripts/copy_templates.py
@@ -21,7 +21,7 @@ if __name__ == "__main__":
with open(full_destination, "r") as f:
content = f.read()
# remove images
- content = re.sub("\!\[.*?\]\((.*?)\)", "", content)
+ content = re.sub(r"\!\[.*?\]\((.*?)\)", "", content)
with open(full_destination, "w") as f:
f.write(content)
@@ -39,7 +39,7 @@ sidebar_class_name: hidden
content = f.read()
# replace relative links
- content = re.sub("\]\(\.\.\/", "](/docs/templates/", content)
+ content = re.sub(r"\]\(\.\.\/", "](/docs/templates/", content)
with open(templates_index_intermediate, "w") as f:
f.write(sidebar_hidden + content)
diff --git a/docs/scripts/resolve_local_links.py b/docs/scripts/resolve_local_links.py
index 1a329cdc66..99414e3c80 100644
--- a/docs/scripts/resolve_local_links.py
+++ b/docs/scripts/resolve_local_links.py
@@ -11,7 +11,7 @@ def update_links(doc_path, docs_link):
content = f.read()
# replace relative links
- content = re.sub("\]\(\.\/", f"]({docs_link}", content)
+ content = re.sub(r"\]\(\.\/", f"]({docs_link}", content)
with open(DOCS_DIR / doc_path, "w") as f:
f.write(content)