From ca847d2f3e7b3b1e23f7ca6addf3c6c860efe879 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 30 Aug 2021 00:20:22 +0900 Subject: [PATCH] Fix #9585: py:property directive does not create a hyperlink for types --- CHANGES | 2 ++ sphinx/domains/python.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 4e98b2c8ab4..df5dd0afa78 100644 --- a/CHANGES +++ b/CHANGES @@ -38,6 +38,8 @@ Bugs fixed * #9456: html search: abbreation marks are inserted to the search result if failed to fetch the content of the page * #9267: html theme: CSS and JS files added by theme were loaded twice +* #9585: py domain: ``:type:`` option for :rst:`dir:`py:property` directive does + not create a hyperlink * #9535 comment: C++, fix parsing of defaulted function parameters that are function pointers. * #9564: smartquotes: don't adjust typography for text with diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index e8330e81cf5..9875a9f4b65 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -861,7 +861,8 @@ def handle_signature(self, sig: str, signode: desc_signature) -> Tuple[str, str] typ = self.options.get('type') if typ: - signode += addnodes.desc_annotation(typ, ': ' + typ) + annotations = _parse_annotation(typ, self.env) + signode += addnodes.desc_annotation(typ, '', nodes.Text(': '), *annotations) return fullname, prefix