Skip to content

Doctest blocks not marked with Python as language and end detection doesn't work #163

@Marrin

Description

@Marrin

Given this source:

def f():
    """
    Description of `f`.
    
    Example:
        >>> f()
        Traceback (most recent call last):
            ...
        Exception: something went wrong
    """
        raise Exception("something went wrong")

Expected Behavior

A code block covering the whole doctest block and with class "python" so the highlighter doesn't have to guess. It consistently guesses Haskell by the way.

Actual Behavior

A code block with class "python" that actually spans the whole doctest block.

Additional info

Setting the doctest block as fenced code block with an explicit language name solves the highlighting problem, but then the traceback is displayed very weird. That code block then shows up as this in the HTML:

>>> f()
Traceback (most recent call last):
    ...
**`Exception`**
:   something went wrong
  • pdoc version: 0.7.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions