From eed51ee14bd973a08395f95377f9bd4cd38febfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Tue, 5 Sep 2023 13:41:11 +0200 Subject: [PATCH] fix: Don't render cross-ref spans when they're not enabled --- .../python/templates/material/_base/expression.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html index 52d3a624..6ba78963 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/expression.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/expression.html @@ -8,9 +8,13 @@ {%- set annotation = full -%} {%- endif -%} {%- for title, path in annotation|split_path(full) -%} - {%- filter stash_crossref(length=title|length) -%} - {{ title }} - {%- endfilter -%} + {%- if not signature or config.signature_crossrefs -%} + {%- filter stash_crossref(length=title|length) -%} + {{ title }} + {%- endfilter -%} + {%- else -%} + {{ title }} + {%- endif -%} {%- if not loop.last -%}.{%- endif -%} {%- endfor -%} {%- endwith -%}