mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix: special toctree entry "self" located after another entry that also has a toctree was replaced with wrong title and link. Closes #1576
Function argument variable `toctreenode` had been overrode by local variable.
This commit is contained in:
parent
91507c367b
commit
b7059d475d
2
CHANGES
2
CHANGES
@ -17,6 +17,8 @@ Bugs fixed
|
||||
:rst:dir:`csv-table`. Thanks to Takeshi Komiya.
|
||||
* PR#285: Test for subclasses of docutils node types when screening
|
||||
searchindex. Thanks to Nathan Goldbaum.
|
||||
* #1576: Special toctree entry "self" located after another entry that also has
|
||||
a toctree was replaced with wrong title and link.
|
||||
|
||||
|
||||
Release 1.2.3 (released Sep 1, 2014)
|
||||
|
@ -1279,16 +1279,16 @@ class BuildEnvironment:
|
||||
subtrees = toplevel.traverse(addnodes.toctree)
|
||||
toplevel[1][:] = subtrees
|
||||
# resolve all sub-toctrees
|
||||
for toctreenode in toc.traverse(addnodes.toctree):
|
||||
if not (toctreenode.get('hidden', False)
|
||||
for subtocnode in toc.traverse(addnodes.toctree):
|
||||
if not (subtocnode.get('hidden', False)
|
||||
and not includehidden):
|
||||
i = toctreenode.parent.index(toctreenode) + 1
|
||||
i = subtocnode.parent.index(subtocnode) + 1
|
||||
for item in _entries_from_toctree(
|
||||
toctreenode, [refdoc] + parents,
|
||||
subtocnode, [refdoc] + parents,
|
||||
subtree=True):
|
||||
toctreenode.parent.insert(i, item)
|
||||
subtocnode.parent.insert(i, item)
|
||||
i += 1
|
||||
toctreenode.parent.remove(toctreenode)
|
||||
subtocnode.parent.remove(subtocnode)
|
||||
if separate:
|
||||
entries.append(toc)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user