Trying to link to a nested module causes broken links
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
I have a package with several nested modules. I wanted to refer to them by their names, without prefixing the package name, so I used a [nested](module.nested) Markdown link. This broke link generation.
Steps to reproduce the behavior:
Create module/. Inside it:
# module/__init__.py
"""
[nested](module.nested)
"""
# module/nested.py
"""Hello there"""
This generates the following HTML:
<div class="docstring">
<p>
<a href="<a href=" module="" nested.html"="">module.nested</a>">nested
</p>
</div>
System Information
$ pdoc --version
pdoc: 15.0.3
Python: 3.12.10
Platform: Linux-6.12.28-0-lts-x86_64-with
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 by reproducing the issue with module/init.py linking to module.nested and module/nested.py, then inspect pdoc's Markdown link generation using the malformed HTML as the failure signal. Done means the nested link renders as a valid anchor pointing to the nested module without duplicated or broken markup.
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
- Clearly specified
- Newbie friendliness
- 48/100