From 92ca8d92b3c7c4119f9f252676150827ac0f276f Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Sun, 10 Jan 2016 23:27:11 +0900 Subject: [PATCH] Fix #1601, #2220: 'any' role breaks extended domains behavior. Affected extensions doesn't support resolve_any_xref and resolve_xref returns problematic node instead of None. sphinxcontrib-httpdomain is one of them. --- CHANGES | 3 +++ sphinx/environment.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index fc3e8e002..de9557ddc 100644 --- a/CHANGES +++ b/CHANGES @@ -47,6 +47,9 @@ Bugs fixed * #2062: Escape characters in doctests are treated incorrectly with Python 2. * #2225: Fix if the option does not begin with dash, linking is not performed * #2226: Fix math is not HTML-encoded when :nowrap: is given (jsmath, mathjax) +* #1601, #2220: 'any' role breaks extended domains behavior. Affected extensions doesn't + support resolve_any_xref and resolve_xref returns problematic node instead of None. + sphinxcontrib-httpdomain is one of them. Release 1.3.3 (released Dec 2, 2015) ==================================== diff --git a/sphinx/environment.py b/sphinx/environment.py index 5d2107299..355901cc9 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -1655,7 +1655,7 @@ class BuildEnvironment: for role in domain.roles: res = domain.resolve_xref(self, refdoc, builder, role, target, node, contnode) - if res: + if res and isinstance(res[0], nodes.Element): results.append(('%s:%s' % (domain.name, role), res)) # now, see how many matches we got... if not results: