-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Space-indented code block loses indentation #259
Comments
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). |
…e, pydocmd and sphinx processors (see #259)
Hello @langfingaz , I did some investigation and it turns out this issue is coming from the
pydoc-markdown/src/pydoc_markdown/contrib/processors/sphinx.py Lines 158 to 163 in c364221
The |
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. |
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 ;)The text was updated successfully, but these errors were encountered: