Skip to content

Commit 9bbfe14

Browse files
authored
refactor: Return all known anchors
1 parent 831aabb commit 9bbfe14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mkdocstrings/handlers/python/renderer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def render(self, data: CollectorItem, config: dict) -> str: # noqa: D102 (ignor
121121
**{"config": final_config, data.kind.value: data, "heading_level": heading_level, "root": True},
122122
)
123123

124-
def get_anchor(self, data: CollectorItem) -> str: # noqa: D102 (ignore missing docstring)
125-
return data.path
124+
def get_anchors(self, data: CollectorItem) -> list[str]: # noqa: D102 (ignore missing docstring)
125+
return list({data.path, data.canonical_path, *data.aliases})
126126

127127
def update_env(self, md: Markdown, config: dict) -> None: # noqa: D102 (ignore missing docstring)
128128
super().update_env(md, config)

0 commit comments

Comments
 (0)