Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 73f11dc

Browse filesBrowse files
committed
fix: Always render cross-references outside of signatures
Issue-mkdocstrings#700: mkdocstrings/mkdocstrings#700
1 parent e6b7542 commit 73f11dc
Copy full SHA for 73f11dc

File tree

1 file changed

+8
-7
lines changed
Filter options

1 file changed

+8
-7
lines changed

‎src/mkdocstrings_handlers/python/templates/material/_base/expression.html.jinja

Copy file name to clipboardExpand all lines: src/mkdocstrings_handlers/python/templates/material/_base/expression.html.jinja
+8-7Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ which is a tree-like structure representing a Python expression.
3232
{%- set annotation = full -%}
3333
{%- endif -%}
3434
{%- for title, path in annotation|split_path(full) -%}
35-
{%- if config.signature_crossrefs -%}
36-
{%- if signature -%}
37-
{%- filter stash_crossref(length=title|length) -%}
38-
<autoref identifier="{{ path }}" optional{% if title != path %} hover{% endif %}>{{ title }}</autoref>
39-
{%- endfilter -%}
40-
{%- else -%}
35+
{%- if not signature -%}
36+
{#- Always render cross-references outside of signatures. We don't need to stash them. -#}
37+
<autoref identifier="{{ path }}" optional{% if title != path %} hover{% endif %}>{{ title }}</autoref>
38+
{%- elif config.signature_crossrefs -%}
39+
{#- We're in a signature and cross-references are enabled, we must render one and stash it. -#}
40+
{%- filter stash_crossref(length=title|length) -%}
4141
<autoref identifier="{{ path }}" optional{% if title != path %} hover{% endif %}>{{ title }}</autoref>
42-
{%- endif -%}
42+
{%- endfilter -%}
4343
{%- else -%}
44+
{#- We're in a signature but cross-references are disabled, we just render the title. -#}
4445
{{ title }}
4546
{%- endif -%}
4647
{%- if not loop.last -%}.{%- endif -%}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.