Skip to content
Permalink
Browse files

BUG: Fix numpydoc interpreting some simple bold text as params

  • Loading branch information...
kernc committed Apr 30, 2019
1 parent ca359aa commit 7d8e211965f6852d2b4516a849fe60a26d9f715c
Showing with 6 additions and 1 deletion.
  1. +1 −1 pdoc/html_helpers.py
  2. +2 −0 pdoc/test/__init__.py
  3. +3 −0 pdoc/test/example_pkg/__init__.py
@@ -145,7 +145,7 @@ def _numpy_seealso(match):
def numpy(text,
# All kinds of numpydoc Parameters (optionally with types; descriptions)
_params=partial(
re.compile(r'^([\w*]+(?:, [\w*]+)*)(?: ?: (.*)(?<!\.)$)?'
re.compile(r'^(\*{0,2}\w+(?:, \*{0,2}\w+)*)(?: ?: (.*)(?<!\.)$)?'
r'((?:\n(?: {4}.*|$))*)', re.MULTILINE).sub,
_numpy_params.__func__),
_seealso=partial(
@@ -780,6 +780,8 @@ def _link(dobj, *args, **kwargs):

def test_numpy(self):
expected = '''<p>Summary line.</p>
<p><strong>Documentation</strong>: <a href="https://pdoc3.github.io/pdoc/doc/pdoc/">https://pdoc3.github.io/pdoc/doc/pdoc/</a>
<strong>Source Code</strong>: <a href="https://github.com/pdoc3/">https://github.com/pdoc3/</a></p>
<h2 id="parameters">Parameters</h2>
<dl>
<dt><strong><code>x1</code></strong>, <strong><code>x2</code></strong> :&ensp;<code>array_like</code></dt>
@@ -110,6 +110,9 @@ def numpy(self):
"""
Summary line.
**Documentation**: https://pdoc3.github.io/pdoc/doc/pdoc/
**Source Code**: https://github.com/pdoc3/
Parameters
----------
x1, x2 : array_like

0 comments on commit 7d8e211

Please sign in to comment.
You can’t perform that action at this time.