Skip to content

Conversation

@ArnaudD-FR
Copy link

When copying toc tree, 'only' nodes should not be copied, but previous implementation always considered 'only' node children as duplicable nodes which is wrong when 'only' nodes is parent of other 'only' nodes.

Subject: Fix _toctree_copy with multi level 'only' nodes.

Feature or Bugfix

  • Bugfix

Purpose

When copying toc tree, 'only' nodes should not be copied, but previous implementation always considered 'only' node children as duplicable nodes which is wrong when 'only' nodes is parent of other 'only' nodes.

Detail

Split _toctree_copy function in two parts:

  • _toctree_copy duplicate nodes as previously but duplicates its children using the next function.
  • _toctree_copy_children handle each node children and takes the decision about copying current node or not. In 'only' node case, this function is called recursively.

Relates

@ArnaudD-FR ArnaudD-FR force-pushed the master branch 3 times, most recently from b1a10a0 to 8f8b0ac Compare November 14, 2024 10:47
…des.

When copying toc tree, 'only' nodes should not be copied, but previous
implementation always considered 'only' node children as duplicable nodes which
is wrong when 'only' nodes is parent of other 'only' nodes.
@ArnaudD-FR
Copy link
Author

@AA-Turner any issue I should be aware about this PR? I have no answer since a while now

@AA-Turner
Copy link
Member

Thank you for this PR! I think the same problem was fixed in #13663.

A

@ArnaudD-FR ArnaudD-FR closed this Jul 29, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants