Skip to content

Doctests are interpreted by the HTML template #63

Closed
@mikael-s

Description

@mikael-s

When producing the output in HTML mode, doctests are simply interpreted as if they were part of markdown syntax and are replaced by (three) blockquotes.

For instance if you have the following code in a test.py file:

def f():
    '''
    >>> f()
    2
    '''
    return 2

Launching pdoc on that file with pdoc --html test.py will produce a HTML file where the docstring is replaced by the following code:

<blockquote>
<blockquote>
<blockquote>
<p>f()
2</p>
</blockquote>
</blockquote>
</blockquote>

Therefore the >>> are removed and the line return is ignored which makes the doctests hardly readable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions