Mangled code block when using --docformat google
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
Problem Description
When using --docformat google, content inside my triple-backtick code block is being mangled.
Steps to reproduce the behavior:
- Attach the following docstring to a function:
"""
Lorem dolor sit amet.
```
ABC:
DEF
GHI
```
"""
-
Compile using
--docformat google -
Resulting <pre><code> element contains:
###### ABC:
> DEF
GHI
When expected content is:
ABC:
DEF
GHI
See reproducer file:
2025-02-11 - pdoc code block.zip
Note that when the colon is removed after "ABC", it does not get mangled. The text is not dependent on "ABC", it can be anything.
System Information
pdoc: 15.0.1
Python: 3.12.8
Platform: macOS-15.3-arm64-arm-64bit
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached reproducer and compile it using --docformat google. Trace how the Google docstring content becomes the generated
element, then verify that the block preserves “ABC:\n DEF\nGHI” rather than the mangled output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100