From 5c2b20e7b147eb1318cce9b816656afe666ad361 Mon Sep 17 00:00:00 2001 From: Ray Zimmerman Date: Tue, 26 Mar 2024 18:01:51 -0600 Subject: [PATCH] Revert "Fix non-functional references with section title with same name." This reverts commit d6775212ce2b9c5d8ed62e5f76494c928602f525. --- sphinxcontrib/matlab.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sphinxcontrib/matlab.py b/sphinxcontrib/matlab.py index e822816..8373764 100644 --- a/sphinxcontrib/matlab.py +++ b/sphinxcontrib/matlab.py @@ -258,6 +258,14 @@ def get_index_text(self, modname, name): def add_target_and_index(self, name_cls, sig, signode): modname = self.options.get("module", self.env.temp_data.get("mat:module")) + if self.env.config.matlab_short_links and not name_cls[0] == modname: + # modname is only used for package names + # - "target.+package" => "package" + # - "target" => "" + parts = modname.split(".") + parts = [part for part in parts if part.startswith("+")] + modname = ".".join(parts) + fullname = (modname and modname + "." or "") + name_cls[0] fullname = fullname.lstrip(".")