diff --git a/pdoc/html_helpers.py b/pdoc/html_helpers.py
index 8ba63db6..51861947 100644
--- a/pdoc/html_helpers.py
+++ b/pdoc/html_helpers.py
@@ -275,6 +275,9 @@ def _admonition(match, module=None, limit_types=None):
if limit_types and type not in limit_types:
return match.group(0)
+ if text is None:
+ text = ""
+
if type == 'include' and module:
try:
return _ToMarkdown._include_file(indent, value,
@@ -323,7 +326,8 @@ def admonitions(text, module, limit_types=None):
See: https://python-markdown.github.io/extensions/admonition/
"""
substitute = partial(re.compile(r'^(?P 1
x = 2
x = 3
-x =
Name | +Value | +
---|---|
Hello | +World | +
Remaining.
''' mod = pdoc.Module(pdoc.import_module( os.path.join(TESTS_BASEDIR, EXAMPLE_MODULE, '_reST_include', 'test.py'))) html = to_html(mod.docstring, module=mod) diff --git a/pdoc/test/example_pkg/_reST_include/table.md b/pdoc/test/example_pkg/_reST_include/table.md new file mode 100644 index 00000000..abf0fc4f --- /dev/null +++ b/pdoc/test/example_pkg/_reST_include/table.md @@ -0,0 +1,3 @@ +| Name | Value | +| ----- | ----- | +| Hello | World | diff --git a/pdoc/test/example_pkg/_reST_include/test.py b/pdoc/test/example_pkg/_reST_include/test.py index 96c25c41..acf75900 100644 --- a/pdoc/test/example_pkg/_reST_include/test.py +++ b/pdoc/test/example_pkg/_reST_include/test.py @@ -8,4 +8,8 @@ .. include:: foo/../_include_me.py :start-after: = :end-before: 4 + +.. include:: table.md + +Remaining. """