diff --git a/pdoc/html_helpers.py b/pdoc/html_helpers.py index d727655c..f5e7e441 100644 --- a/pdoc/html_helpers.py +++ b/pdoc/html_helpers.py @@ -248,14 +248,14 @@ def googledoc_sections(match): section = section.title() if section in ('Args', 'Attributes'): body = re.compile( - r'^([\w*]+)(?: \(([\w.,=\[\] -]+)\))?: ' + r'^([\w*]+)(?: \(([\w.,=|\[\] -]+)\))?: ' r'((?:.*)(?:\n(?: {2,}.*|$))*)', re.MULTILINE).sub( lambda m: _ToMarkdown._deflist(*_ToMarkdown._fix_indent(*m.groups())), inspect.cleandoc(f'\n{body}') ) elif section in ('Returns', 'Yields', 'Raises', 'Warns'): body = re.compile( - r'^()([\w.,\[\] ]+): ' + r'^()([\w.,|\[\] ]+): ' r'((?:.*)(?:\n(?: {2,}.*|$))*)', re.MULTILINE).sub( lambda m: _ToMarkdown._deflist(*_ToMarkdown._fix_indent(*m.groups())), inspect.cleandoc(f'\n{body}') diff --git a/pdoc/test/__init__.py b/pdoc/test/__init__.py index 93b9c771..6f706b03 100644 --- a/pdoc/test/__init__.py +++ b/pdoc/test/__init__.py @@ -1457,6 +1457,8 @@ def test_google(self):
arg2
: str
or int
arg3
: str | None
test_sequence
2-dim numpy array of real numbers, size: N * D @@ -1484,6 +1486,11 @@ def test_google(self):
Dict[int, pdoc.Doc]
int | str
AttributeError