#490: Fix cross-references to objects of types added by the :func:~.Sphinx.add_object_type API function.

This commit is contained in:
Georg Brandl 2010-08-14 16:51:04 +02:00
parent 8a17f7a84f
commit a484c6f793
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,9 @@
Release 1.0.2 (Aug 05, 2010)
============================
* #490: Fix cross-references to objects of types added by the
:func:`~.Sphinx.add_object_type` API function.
* Allow breaking long signatures, continuing with backlash-escaped
newlines.

View File

@ -484,7 +484,13 @@ class StandardDomain(Domain):
return make_refnode(builder, fromdocname, docname,
labelid, contnode)
else:
docname, labelid = self.data['objects'].get((typ, target), ('', ''))
objtypes = self.objtypes_for_role(typ) or []
for objtype in objtypes:
if (objtype, target) in self.data['objects']:
docname, labelid = self.data['objects'][objtype, target]
break
else:
docname, labelid = '', ''
if not docname:
if typ == 'term':
env.warn(node.get('refdoc', fromdocname),

View File

@ -166,7 +166,7 @@ HTML_XPATH = {
(".//a[@href='#mod.Cls'][@class='reference internal']", ''),
(".//dl[@class='userdesc']", ''),
(".//dt[@id='userdesc-myobj']", ''),
(".//a[@href='#userdesc-myobj']", ''),
(".//a[@href='#userdesc-myobj'][@class='reference internal']", ''),
# C references
(".//span[@class='pre']", 'CFunction()'),
(".//a[@href='#Sphinx_DoSomething']", ''),