mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add a minimal test for external toctree links and fix a small bug found by it.
This commit is contained in:
@@ -1005,8 +1005,9 @@ class BuildEnvironment:
|
||||
_walk_depth(newnode, 1, prune and maxdepth or 0)
|
||||
# set the target paths in the toctrees (they are not known at TOC generation time)
|
||||
for refnode in newnode.traverse(nodes.reference):
|
||||
refnode['refuri'] = builder.get_relative_uri(
|
||||
docname, refnode['refuri']) + refnode['anchorname']
|
||||
if not refnode['refuri'].startswith('http://'): # FIXME: see above
|
||||
refnode['refuri'] = builder.get_relative_uri(
|
||||
docname, refnode['refuri']) + refnode['anchorname']
|
||||
return newnode
|
||||
|
||||
descroles = frozenset(('data', 'exc', 'func', 'class', 'const', 'attr', 'obj',
|
||||
|
||||
@@ -18,6 +18,8 @@ Contents:
|
||||
math
|
||||
autodoc
|
||||
|
||||
Python <http://python.org/>
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ HTML_XPATH = {
|
||||
".//li[@class='toctree-l2']/a": 'Admonitions',
|
||||
".//title": 'Sphinx <Tests>',
|
||||
".//div[@class='footer']": 'Georg Brandl & Team',
|
||||
".//a[@href='http://python.org/']": '',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user