mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix #1772 cross reference in docstrings like `:param .write:
` breaks building.
This commit is contained in:
parent
4e599c13da
commit
70612c610f
1
CHANGES
1
CHANGES
@ -8,6 +8,7 @@ Bugs fixed
|
||||
doesn't overwrite existent files/dirs. Thanks to WAKAYAMA shirou.
|
||||
* #1773: sphinx-quickstart doesn't accept non-ASCII character as a option argument.
|
||||
* #1766: the message "least Python 2.6 to run" is at best misleading.
|
||||
* #1772: cross reference in docstrings like ``:param .write:`` breaks building.
|
||||
|
||||
|
||||
Release 1.3 (released Mar 10, 2015)
|
||||
|
@ -90,13 +90,15 @@ class PyXrefMixin(object):
|
||||
result = super(PyXrefMixin, self).make_xref(rolename, domain, target,
|
||||
innernode, contnode)
|
||||
result['refspecific'] = True
|
||||
if target.startswith('.'):
|
||||
result['reftarget'] = target[1:]
|
||||
result[0][0] = nodes.Text(target[1:])
|
||||
if target.startswith('~'):
|
||||
result['reftarget'] = target[1:]
|
||||
title = target.split('.')[-1]
|
||||
result[0][0] = nodes.Text(title)
|
||||
if target.startswith(('.', '~')):
|
||||
prefix, result['reftarget'] = target[0], target[1:]
|
||||
if prefix == '.':
|
||||
text = target[1:]
|
||||
elif prefix == '~':
|
||||
text = target.split('.')[-1]
|
||||
for node in result.traverse(nodes.Text):
|
||||
node.parent[node.parent.index(node)] = nodes.Text(text)
|
||||
break
|
||||
return result
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user