Open langfingaz opened 2 years ago
Thanks for reporting this issue @langfingaz ! I've experienced this as well but have not found the time to fix it yet :( I might get around to fix it sometime later this week. If you dare to take a look at it yourself, you want to look at the code for the preprocessors (I'm not sure yet if this issue affects all preprocessors).
Hello @langfingaz ,
I did some investigation and it turns out this issue is coming from the docstring_parser
module.
The short_description
is Example:
and the long_description
contains your code block, though unfortunately with the leading whitespace removed.
Hey there :)
is this the same problem I get for the following docstring?
def foo(arg1: int, **kwargs: dict):
"""
Args:
arg1: The first argument.
A longer description of the argument.
There is even a table.
| value | description |
|--------|-------------------|
| 1-10 | some text |
| 10-100 | some other text |
kwargs: Additional options.
Longer description of possible kwargs.
Recogniced keywords include:
* kw_arg1 (bool): description of first keyword
Longer description the keyword.
* kw_arg2 (int): description of the second keyword
Longer description of the keyword.
There is even a table:
| value | description |
|-------|----------------|
| 0 | no output |
| 1 | some output |
| 2 | lots of output |
* kw_arg3 (bool): description of third keyword
Longer description of the keyword.
This includes a list:
- nested list item
- other nested list item
"""
I get the following md-code
**Arguments**:
- `arg1` - The first argument.
A longer description of the argument.
There is even a table.
| value | description |
|--------|-------------------|
| 1-10 | some text |
| 10-100 | some other text |
- `kwargs` - Additional options.
Longer description of possible kwargs.
Recogniced keywords include:
* kw_arg1 (bool): description of first keyword
Longer description the keyword.
* kw_arg2 (int): description of the second keyword
Longer description of the keyword.
There is even a table:
| value | description |
|-------|----------------|
| 0 | no output |
| 1 | some output |
| 2 | lots of output |
* kw_arg3 (bool): description of third keyword
Longer description of the keyword.
This includes a list:
- nested list item
- other nested list item
The nested structures are not correctly indented. I would appreciate a fix for this.
Environment
I am using the cli interface:
Describe the bug
The first line of a code block (that is not surrounded by 3-ticks, but instead indented with 4 spaces) looses its indentation.
Here is a docstring of a python function:
And here the generated markdown:
Expected behavior
All 3 lines of the codeblock should keep their indendations.
Note:
The above bug does also occur when one does not use the
>
sign. So this is not the problem here ;)