Skip to content
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

Incorrect source dropdowns when a function matches the module's name #431

Closed
tlgs opened this issue Aug 24, 2022 · 0 comments
Closed

Incorrect source dropdowns when a function matches the module's name #431

tlgs opened this issue Aug 24, 2022 · 0 comments
Labels

Comments

@tlgs
Copy link

tlgs commented Aug 24, 2022

Problem Description

When the name of a function matches the name of the module, View Source panels don't work as intended, i.e. clicking on the function's label will expand the full module's source.

This happens because multiple label elements will be generated with the same id in the for attribute.

Titling this issue was a bit of a doozy, feel free to rename to something more descriptive.

Steps to reproduce the behavior:

$ mkdir foo
$ touch foo/__init__.py
$ echo -e 'class foo:\n    ...\n\nclass bar:\n    ...\n\ndef foo():\n    ...' > foo/foo.py
$ pdoc foo

While coming up with this simple example I must have encountered another bug... 😅
pdoc is seemingly skipping the first class when rendering the module's documentation.

System Information

pdoc: 12.1.0
Python: 3.10.6
Platform: Linux-5.19.3-arch1-1-x86_64-with-glibc2.36
@tlgs tlgs added the bug label Aug 24, 2022
@mhils mhils closed this as completed in de81d7e Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant