diff --git a/sphinx/sphinx_to_html.py b/sphinx/sphinx_to_html.py
index f293a7e..f7b1c49 100755
--- a/sphinx/sphinx_to_html.py
+++ b/sphinx/sphinx_to_html.py
@@ -70,10 +70,10 @@ with tempfile.TemporaryDirectory() as tmp_dir:
return f"image:: {image_url}/{matchobj.group(1).strip('/')}"
page_contents = re.sub(":doc:`/(.+?)`", doc_link, page_contents)
- page_contents = re.sub(":doc:`(.+?)<(.+?)>`", doc_label_link, page_contents)
- page_contents = re.sub(":ref:`(.+?)<(.+?)>`", ref_label_link, page_contents)
+ page_contents = re.sub(":doc:`([\w\s\n-]+?)\n?<(.+?)>`", doc_label_link, page_contents)
+ page_contents = re.sub(":ref:`([\w\s\n-]+?)\n?<(.+?)>`", ref_label_link, page_contents)
page_contents = re.sub(":ref:`([\w\s-]+?)`", ref_link, page_contents)
- page_contents = re.sub(":term:`(.+?)<(.+?)>`", term_link, page_contents)
+ page_contents = re.sub(":term:`([\w\s\n-]+?)\n?<(.+?)>`", term_link, page_contents)
page_contents = re.sub(":term:`([\w\s-]+?)`", term_link, page_contents)
page_contents = re.sub("figure:: (.+?)", figure_link, page_contents)
page_contents = re.sub("image:: (.+?)", image_link, page_contents)
@@ -87,6 +87,9 @@ with tempfile.TemporaryDirectory() as tmp_dir:
page_contents = re.sub("literalinclude::(.*)", include_directive, page_contents)
page_contents = re.sub("include::(.*)", include_directive, page_contents)
page_contents = re.sub("raw::(.*)", raw_directive, page_contents)
+ page_contents = re.sub(".. toctree::(.*)", ".. code-block:: none", page_contents)
+ page_contents = re.sub(":maxdepth:(.*)", "", page_contents)
+ page_contents = page_contents.replace("|BLENDER_VERSION|", "BLENDER_VERSION")
page_filepath.write_text(page_contents)