diff --git a/CHANGELOG.md b/CHANGELOG.md
index 117e17ba..4ee707a1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [1.6.2](https://github.com/mkdocstrings/python/releases/tag/1.6.2) - 2023-09-05
+
+[Compare with 1.6.1](https://github.com/mkdocstrings/python/compare/1.6.1...1.6.2)
+
+### Bug Fixes
+
+- Don't render cross-ref spans when they're not enabled ([eed51ee](https://github.com/mkdocstrings/python/commit/eed51ee14bd973a08395f95377f9bd4cd38febfc) by Timothée Mazzucotelli).
+
## [1.6.1](https://github.com/mkdocstrings/python/releases/tag/1.6.1) - 2023-09-04
[Compare with 1.6.0](https://github.com/mkdocstrings/python/compare/1.6.0...1.6.1)
diff --git a/src/mkdocstrings_handlers/python/rendering.py b/src/mkdocstrings_handlers/python/rendering.py
index b2869bf9..46b34c01 100644
--- a/src/mkdocstrings_handlers/python/rendering.py
+++ b/src/mkdocstrings_handlers/python/rendering.py
@@ -88,13 +88,17 @@ def do_format_signature(
function: Function,
line_length: int,
*,
+ annotations: bool | None = None, # noqa: ARG001
crossrefs: bool = False, # noqa: ARG001
) -> str:
"""Format a signature using Black.
Parameters:
+ context: Jinja context, passed automatically.
callable_path: The path of the callable we render the signature of.
+ function: The function we render the signature of.
line_length: The line length to give to Black.
+ annotations: Whether to show type annotations.
crossrefs: Whether to cross-reference types in the signature.
Returns:
@@ -126,6 +130,7 @@ def do_format_attribute(
"""Format an attribute using Black.
Parameters:
+ context: Jinja context, passed automatically.
attribute_path: The path of the callable we render the signature of.
attribute: The attribute we render the signature of.
line_length: The line length to give to Black.
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 -%}