diff --git a/docs/source/conf.py b/docs/source/conf.py index be5275d5cc..3016036e46 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -276,7 +276,7 @@ def autodoc_post_process_docstring(app, what, name, obj, options, lines): doc = re.sub(r"```", "", doc, flags=re.MULTILINE) doc = re.sub(r"`{1}", "**", doc, flags=re.MULTILINE) doc = re.sub( - r"^(?P#{1,2})\s*?(?P.*?)$", _sub_header, doc, flags=re.MULTILINE + r"^(?P<hashes>#{1,4})\s*?(?P<title>.*?)$", _sub_header, doc, flags=re.MULTILINE ) newlines = doc.split("\n")