Skip to content

Commit 1dbb782

Browse files
kernceladyn
andcommitted
BUG: Fix line offset for full module Browse git link
Fixes: #296 Co-authored-by: fweisser <[email protected]>
1 parent 49b7773 commit 1dbb782

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pdoc/html_helpers.py

+1
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ def format_git_link(template: str, dobj: pdoc.Doc):
566566
path = path.replace('\\', '/')
567567

568568
lines, start_line = inspect.getsourcelines(dobj.obj)
569+
start_line = start_line or 1 # GH-296
569570
end_line = start_line + len(lines) - 1
570571
url = template.format(**locals())
571572
return url

0 commit comments

Comments
 (0)