Clean up api doc header suprocessing, other fixes

This commit is contained in:
Griatch 2020-07-31 16:11:30 +02:00
parent ba717a437e
commit dd6a7875bf
8 changed files with 332 additions and 57 deletions

View file

@ -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<hashes>#{1,2})\s*?(?P<title>.*?)$", _sub_header, doc, flags=re.MULTILINE
r"^(?P<hashes>#{1,4})\s*?(?P<title>.*?)$", _sub_header, doc, flags=re.MULTILINE
)
newlines = doc.split("\n")