diff --git a/sphinx_immaterial/apidoc/format_signatures.py b/sphinx_immaterial/apidoc/format_signatures.py index 54023ca6..d6a94c00 100644 --- a/sphinx_immaterial/apidoc/format_signatures.py +++ b/sphinx_immaterial/apidoc/format_signatures.py @@ -577,18 +577,20 @@ def _sig_transform_parameter( ignored, node, "(", ")" ) ), - sphinx.addnodes.desc_type_parameter_list: ( - lambda ignored, node: _sig_transform_desc_parameter_list( - ignored, node, "[", "]" - ) - ), sphinx.addnodes.desc_parameter: _sig_transform_parameter, - sphinx.addnodes.desc_type_parameter: _sig_transform_parameter, sphinx.addnodes.desc_returns: _sig_transform_desc_returns, sphinx.addnodes.pending_xref: _sig_transform_generic, sphinx.ext.viewcode.viewcode_anchor: _sig_transform_viewcode_anchor, } +if sphinx.version_info >= (7, 3): + _SIG_TRANSFORM_FUNCS[ + sphinx.addnodes.desc_type_parameter_list + ] = lambda ignored, node: _sig_transform_desc_parameter_list( + ignored, node, "[", "]" + ) + _SIG_TRANSFORM_FUNCS[sphinx.addnodes.desc_type_parameter] = _sig_transform_parameter + def _sig_transform_node( ignored: set[int], node: docutils.nodes.Node