Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #8870: Use title node for the caption of toctree #9053

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Apr 4, 2021

Feature or Bugfix

  • Bugfix
  • Refactoring

Purpose

@tk0miya
Copy link
Member Author

tk0miya commented Apr 7, 2021

It seems this should be merged into 3.5.x instead of 4.x

Since docutils-0.17, the caption node should not use for the non-figure
nodes.  Therefore, this replaces it by the title node.
@tk0miya tk0miya force-pushed the title_node_for_toctree_caption branch from 4dd3aba to 5604f9c Compare April 8, 2021 16:02
@tk0miya tk0miya merged commit ce5d66e into sphinx-doc:master Apr 8, 2021
@tk0miya tk0miya deleted the title_node_for_toctree_caption branch April 8, 2021 16:35
@tk0miya
Copy link
Member Author

tk0miya commented Apr 8, 2021

Oops... I wrongly merged this into the master branch... I'll cherry-pick it manually.

jdknight added a commit to sphinx-contrib/confluencebuilder that referenced this pull request Apr 11, 2021
As of Sphinx v3.5.4, changes have been made to the application where a
`:caption:` hint on a toctree node will create a `nodes.title` instance
instead of an `nodes.caption` instance. This modification was introduced
to support styling changes introduced in docutils-0.17 [1].

This commit adjusts the `visit_title` to detect if the title entry is
being built from a toctree node -- if so, forward the node processing
back to the existing caption implementation.

[1]: sphinx-doc/sphinx#9053

Signed-off-by: James Knight <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant