Skip to content

Commit

Permalink
fix: Always render cross-references outside of signatures
Browse files Browse the repository at this point in the history
Issue-mkdocstrings#700: mkdocstrings/mkdocstrings#700
  • Loading branch information
pawamoy committed Oct 19, 2024
1 parent e6b7542 commit 73f11dc
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ which is a tree-like structure representing a Python expression.
{%- set annotation = full -%}
{%- endif -%}
{%- for title, path in annotation|split_path(full) -%}
{%- if config.signature_crossrefs -%}
{%- if signature -%}
{%- filter stash_crossref(length=title|length) -%}
<autoref identifier="{{ path }}" optional{% if title != path %} hover{% endif %}>{{ title }}</autoref>
{%- endfilter -%}
{%- else -%}
{%- if not signature -%}
{#- Always render cross-references outside of signatures. We don't need to stash them. -#}
<autoref identifier="{{ path }}" optional{% if title != path %} hover{% endif %}>{{ title }}</autoref>
{%- elif config.signature_crossrefs -%}
{#- We're in a signature and cross-references are enabled, we must render one and stash it. -#}
{%- filter stash_crossref(length=title|length) -%}
<autoref identifier="{{ path }}" optional{% if title != path %} hover{% endif %}>{{ title }}</autoref>
{%- endif -%}
{%- endfilter -%}
{%- else -%}
{#- We're in a signature but cross-references are disabled, we just render the title. -#}
{{ title }}
{%- endif -%}
{%- if not loop.last -%}.{%- endif -%}
Expand Down

0 comments on commit 73f11dc

Please sign in to comment.