mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Clarify error message when any role has more than one target.
(by including the full names of the candidate targets)
This commit is contained in:
@@ -134,7 +134,8 @@ class ReferencesResolver(SphinxTransform):
|
||||
if not results:
|
||||
return None
|
||||
if len(results) > 1:
|
||||
nice_results = ' or '.join(':%s:' % r[0] for r in results)
|
||||
nice_results = ' or '.join(':%s:`%s`' % (name, role["reftitle"])
|
||||
for name, role in results)
|
||||
logger.warning(__('more than one target found for \'any\' cross-'
|
||||
'reference %r: could be %s'), target, nice_results,
|
||||
location=node)
|
||||
|
||||
Reference in New Issue
Block a user